Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2005 P. Kouznetsov Computing with Reads and Writes in the Absence of Step Contention Hagit Attiya Rachid Guerraoui Petr Kouznetsov School of Computer.

Similar presentations


Presentation on theme: "© 2005 P. Kouznetsov Computing with Reads and Writes in the Absence of Step Contention Hagit Attiya Rachid Guerraoui Petr Kouznetsov School of Computer."— Presentation transcript:

1 © 2005 P. Kouznetsov Computing with Reads and Writes in the Absence of Step Contention Hagit Attiya Rachid Guerraoui Petr Kouznetsov School of Computer and Communication Sciences EPFL Department of Computer Science Technion

2 2 How to implement a concurrent system using reads and writes  Traditional lock-based solutions are inefficient (deadlocks)  Traditional lock-free solutions are expensive (strong synchronization primitives, failure detectors)  Exploiting the absence of step contention Obstruction-free Solo-fast

3 3 Outline  Background Lock-free computing  Contribution Step contention Obstruction-free implementations Solo-fast implementations  Perspectives

4 4 Lock-free distributed computing Given a distributed shared memory system with certain base objects, which objects can be implemented lock-free ? [Lamport, 1978]

5 5 Implementing an object Devise a distributed algorithm that, using base (hardware) objects, provides an illusion of the object implemented in a hardware p1 p2 p3 enq(1) ok deq()01 enq(0)

6 6 Safety Linearizability: every operation appears instantaneously between its invocation and response events p1 p2 p3 enq(1) ok deq()01 enq(0)

7 7 Liveness Ideally, wait-freedom : any process completes any operation, regardless of the behavior of other processes ? Not wait-free

8 8 Register base objects (usually available) p1 p2 p3 W W R W R R

9 9 Any object from registers? Wait-free consensus from reads and writes is impossible [Fischer et al., 1985], [Dolev et al., 1987] [Loui and Abu-Amara, 1987], [Herlihy, 1991] Why consensus? 1. Universal 2. Indispensable Why impossible? Steps of concurrent processes interleave

10 10 How to achieve wait-freedom Registers Failure detectors Powerful base objects Wait-freedom & Linearizability 1. Complex 2. Expensive Progress for everyone?

11 11 Progress for lucky ones Guarantee progress only when you run alone, i.e., encounter no contention (the most common case in practice) [Herlihy et al., ICDCS 2003, DISC 2003]

12 12 Outline  Background Lock-free computing using reads and writes  Contribution Step contention Obstruction-free implementations Solo-fast implementations  Perspectives

13 13 Step contention The step contention of an execution fragment is the number of processes that take steps in the fragment’s interval The interval contention counts the number of operations p1 p2 p3 ir i’r’ SC(i,r)=2 IC(i,r)=3 SC(i’,r’)=1 IC(i’,r’)=2

14 14 Solo termination [Fich et al., 1998] Every operation that eventually encounters no step contention must return p1 p2 p3 ir

15 15 Using interval contention? [Luchangco et al., 2003]  When there is no interval contention: terminate using only reads and writes  When there is interval contention terminate using hardware C&S Constant in time and space! But not much different from lock-based 

16 16 When there is step contention 1. Keep trying (obstruction-free) 2. Use “expensive” primitives (solo-fast)

17 17 Outline  Background Lock-free computing  Contribution Step contention Obstruction-free implementations Solo-fast implementations  Concluding remarks

18 18 Obstruction-free interface Obstruction-free object invocation response wait fail wait = might have taken effect fail = did not take effect

19 19 Returning control in case of contention Wait and try again later p1 p2 p3 ir wait

20 20 Returning control in case of contention Abort the operation p1 p2 p3 i waitfail

21 21 Only fail? Obstruction-free object invocation response fail (no effect) Transaction-like operations?

22 22 Only fail? One “only-fail” consensus object C and one registers R can be used to implement 2- process wait-free consensus Code for p1: propose(v1) x1 := C.propose(v1) if x1=fail then x1:=R return x1 Code for p2: propose(v2) R := v2 repeat x2=C.propose(v2) until x2 <> fail return x2

23 23 Obstruction-free objects do exist!  Time complexity There is a step contention-free operation that takes Ω(n) steps  Space complexity Ω(n) of registers are used And this is optimal! (reduction to [Jayanti et al., 2000]) Registers OF & linearizable implecmentation of any object

24 24 Gracefull degradation? Ω + registers WF consensus Registers only OF consensus Gracefully degrading consensus?  WF if Ω «behaves well»  OF otherwise Not possible (reduction to [LA87, DDS87, Her91])

25 25 Outline  Background Lock-free computing  Contribution Step contention Obstruction-free algorithms Solo-fast implementations  Perspectives

26 26 Solo-fast implementations Solo-fast implementation of any object: linear in time and space (seems to be optimal) if no step contention detected then use registers to terminate else use “expensive” primitives to terminate

27 27 Bottom line Lock-based solutions Wait-free solutions Inefficient Expensive Obstruction-free & solo-fast implementations: - For any object - Linear in time and space Inherently expensive?

28 28 Perspectives  Complexity of obstruction-free consensus (at least non- constant)  Complexity of solo-fast implementations (using slightly more powerful primitives on a fast path)  Optimal contention management

29 29 Thank you!


Download ppt "© 2005 P. Kouznetsov Computing with Reads and Writes in the Absence of Step Contention Hagit Attiya Rachid Guerraoui Petr Kouznetsov School of Computer."

Similar presentations


Ads by Google