The Weakest Failure Detectors to Boost Obstruction-Freedom Rachid - - PowerPoint PPT Presentation

the weakest failure detectors to boost obstruction freedom
SMART_READER_LITE
LIVE PREVIEW

The Weakest Failure Detectors to Boost Obstruction-Freedom Rachid - - PowerPoint PPT Presentation

The Weakest Failure Detectors to Boost Obstruction-Freedom Rachid Guerraoui 1 Micha Kapaka 1 Petr Kouznetsov 2 1 EPFL, Switzerland 2 MPI-SWS, Germany DISC 2006, 20.IX 2006 Micha Kapaka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX


slide-1
SLIDE 1

The Weakest Failure Detectors to Boost Obstruction-Freedom

Rachid Guerraoui1 Michał Kapałka1 Petr Kouznetsov2

1EPFL, Switzerland 2MPI-SWS, Germany

DISC 2006, 20.IX 2006

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 1 / 13

slide-2
SLIDE 2

Introduction

Problems with Concurrent Programming

Multi-processor/-core ⇒ synchronization techniques essential Ideal implementations of shared

  • bjects:

Linearizable (atomic) + Wait-free or Non-blocking (lock-free) Wait-free = progress for everyone Non-blocking = progress for someone Shared object process p1 process p2

  • peration op1
  • peration op2

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 2 / 13

slide-3
SLIDE 3

Introduction

Problems with Wait-Freedom/Non-blockingness

But wait-free/non-blocking + linearizable algorithms: Difficult to design Difficult to optimize for average case = low contention

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 3 / 13

slide-4
SLIDE 4

Obstruction-Freedom and Contention Management

Solution: Separation of Concerns

Two independent modules:

1 Obstruction-free (OF) algorithm ⇒ safety + minimal liveness

Must always return correct results (linearizability) Obstruction-freedom: progress guaranteed only when no contention

2 Contention manager (CM) ⇒ boosts liveness

CM has limited power ⇒ safety always preserved, even when CM behaves badly.

The idea adopted by OF software transactional memory

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 4 / 13

slide-5
SLIDE 5

Obstruction-Freedom and Contention Management

Contention Manager

OF communicates with CM only via calls try and resign (no parameters, return OK) But CM cannot mess up with safety ⇒ CM can only delay a process that calls try to help other processes try = when operation starts or when contention resign = when operation completes OF algorithm process pi CM

  • peration opk

tryi / resigni

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 5 / 13

slide-6
SLIDE 6

Obstruction-Freedom and Contention Management

Providing Wait-Freedom

Our focus: CM that guarantees wait-freedom or non-blockingness How? By allowing each (some) process to run its operation in isolation sufficiently long How long is sufficiently long? Asynchronous system ⇒ no upper bound ⇒ until the operation is completed, or the process crashes

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 6 / 13

slide-7
SLIDE 7

Obstruction-Freedom and Contention Management

Wait-Free CM – an Example

Process p1 Process p2 starts op1 starts op1 suspended runs alone completes op1 continues contention starts op2 suspended runs alone completes op2 continues . . . . . . p1 has to be blocked indefinitely long (p2 may be very slow). But if p2 crashes, p1 cannot remain blocked forever! CM needs some information about failures.

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 7 / 13

slide-8
SLIDE 8

Obstruction-Freedom and Contention Management

Wait-Free CM – an Example

Process p1 Process p2 starts op1 starts op1 suspended runs alone completes op1 continues contention starts op2 suspended runs alone completes op2 continues . . . . . . blocked by CM runs alone completes op1 p1 has to be blocked indefinitely long (p2 may be very slow). But if p2 crashes, p1 cannot remain blocked forever! CM needs some information about failures.

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 7 / 13

slide-9
SLIDE 9

Obstruction-Freedom and Contention Management

Wait-Free CM – an Example

Process p1 Process p2 starts op1 starts op1 suspended runs alone completes op1 continues contention starts op2 suspended runs alone completes op2 continues . . . . . . blocked by CM runs alone continues

CRASHES

p1 has to be blocked indefinitely long (p2 may be very slow). But if p2 crashes, p1 cannot remain blocked forever! CM needs some information about failures.

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 7 / 13

slide-10
SLIDE 10

Obstruction-Freedom and Contention Management

The Question

Question What is the minimal amount of information about failures needed to guarantee wait-freedom using a CM? Answer Information about failures has to be eventually accurate (♦P).

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 8 / 13

slide-11
SLIDE 11

Obstruction-Freedom and Contention Management

The Question

Question What is the minimal amount of information about failures needed to guarantee wait-freedom using a CM? Answer Information about failures has to be eventually accurate (♦P).

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 8 / 13

slide-12
SLIDE 12

Wait-Free CM Proof Sketch

Sufficiency Part

Basic idea: make processes execute operations one by one ⇒ no contention initially: T[1, . . . , n] ← ⊥ upon tryi do if T[i] = ⊥ then T[i] ← GetTimestamp() repeat leaderi ← the non-crashed process that announced the lowest non-⊥ ts in T until leaderi = i upon resigni do T[i] ← ⊥

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 9 / 13

slide-13
SLIDE 13

Wait-Free CM Proof Sketch

Necessity Part

The main idea: We have an algorithm C implementing a CM that guarantees wait-freedom. For every pair of processes pi and pj (pi never crashes) we want that:

1 If pj crashes, then pi eventually permanently suspects pj, 2 If pj never crashes, then pi eventually stops suspecting pj forever.

We make pi and pj invoke try and resign on C ⇒ simulate an execution of an OF algorithm

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 10 / 13

slide-14
SLIDE 14

Wait-Free CM Proof Sketch

Necessity Part (2)

Process pi Process pj tryi tryj suspect pj inc Rj wait for inc Rj stop suspecting pj tryj resigni inc Rj . . . tryi suspect pj . . .

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 11 / 13

slide-15
SLIDE 15

Wait-Free CM Proof Sketch

Necessity Part (2)

Process pi Process pj tryi tryj suspect pj inc Rj wait for inc Rj stop suspecting pj tryj resigni

CRASHES

tryi suspect pj wait for inc Rj If pj crashes: pi suspects pj and waits for Rj forever

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 11 / 13

slide-16
SLIDE 16

Wait-Free CM Proof Sketch

Necessity Part (2)

Process pi Process pj tryi tryj suspect pj inc Rj wait for inc Rj stop suspecting pj tryj resigni inc Rj . . . tryi blocked by CM If pj never crashes: CM must eventually make pj perform steps alone ⇒ block pi until pj resigns, But pj never resigns ⇒ pi blocked forever, not suspecting pi, A subtlety: OF is violated then, but if CM releases pi ∞ many times, OF holds and CM violates wait-freedom.

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 11 / 13

slide-17
SLIDE 17

Summary

Contribution

Main results:

1 ♦P is the weakest failure detector to implement a wait-free

contention manager

2 Ω∗ is the weakest failure detector to implement a non-blocking

contention manager (Ω ≺ Ω∗ ≺ ♦P) But also:

1 Separation of concerns has a cost 2 Prove that wait-freedom is more difficult than non-blockingness 3 Give a precise model of interaction between obstruction-free

algorithm and contention manager

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 12 / 13

slide-18
SLIDE 18

Summary

Related Work

We do not consider overhead of CM Some discussion + wait-free CM algorithm: Fich et al. (DISC’05) More about overhead: see our companion paper (EPFL technical report)

Michał Kapałka (EPFL) The Weakest FD to Boost OF DISC 2006, 20.IX 2006 13 / 13