Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.

Similar presentations


Presentation on theme: "1 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization."— Presentation transcript:

1 1 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld Chapter 10 Timing-based Algorithms Chapter 10 Timing-based Algorithms Version: June 2014

2 2 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 A note on the use of these ppt slides: I am making these slides freely available to all (faculty, students, readers). They are in PowerPoint form so you can add, modify, and delete slides and slide content to suit your needs. They obviously represent a lot of work on my part. In return for use, I only ask the following:  That you mention their source, after all, I would like people to use my book!  That you note that they are adapted from (or perhaps identical to) my slides, and note my copyright of this material. Thanks and enjoy! Gadi Taubenfeld All material copyright 2014 Gadi Taubenfeld, All Rights Reserved A note on the use of these ppt slides: I am making these slides freely available to all (faculty, students, readers). They are in PowerPoint form so you can add, modify, and delete slides and slide content to suit your needs. They obviously represent a lot of work on my part. In return for use, I only ask the following:  That you mention their source, after all, I would like people to use my book!  That you note that they are adapted from (or perhaps identical to) my slides, and note my copyright of this material. Thanks and enjoy! Gadi Taubenfeld All material copyright 2014 Gadi Taubenfeld, All Rights Reserved Synchronization Algorithms and Concurrent Programming ISBN: 0131972596, 1 st edition Synchronization Algorithms and Concurrent Programming ISBN: 0131972596, 1 st edition To get the most updated version of these slides go to: http://www.faculty.idc.ac.il/gadi/book.htm

3 3 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 10.1 Timing-based Algorithms 10.2 Mutual Exclusion with Known Delays 10.3 Fast Mutual Exclusion with Known Delays 10.4 Consensus with Known Delays 10.5 Fast Consensus with Known Delays 10.6 Fast Consensus with Unknown Delays 10.7 Fast Mutual Exclusion with Unknown Delays 10.1 Timing-based Algorithms 10.2 Mutual Exclusion with Known Delays 10.3 Fast Mutual Exclusion with Known Delays 10.4 Consensus with Known Delays 10.5 Fast Consensus with Known Delays 10.6 Fast Consensus with Unknown Delays 10.7 Fast Mutual Exclusion with Unknown Delays Chapter 10 Timing-based Algorithms Chapter 10 Timing-based Algorithms We will also discuss the (recent) subject of “Computing in the Presence of Timing Failures” which does not appear in the 1 st edition of the book.

4 4 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014... M MM C M C PPPPPP Shared Memory Models Coherent Caching Distributed Shared Memory Simple Shared Memory  Communication via shared objects, plus  Timing assumptions.

5 5 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Time models of computation SynchronousAsynchronousPartially synchronous less powerful realistic extremely powerful unrealistic

6 6 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014  Asynchronous: no bound on how much time it takes to access a shared register.  Known Delays : Such a bound exists and is known.  Unknown Delays: Such a bound exists but is not known.  – the time it takes the slowest process to complete a single access to a shared register. delay(d) – delay for d time units.  Asynchronous: no bound on how much time it takes to access a shared register.  Known Delays : Such a bound exists and is known.  Unknown Delays: Such a bound exists but is not known.  – the time it takes the slowest process to complete a single access to a shared register. delay(d) – delay for d time units. Modeling Timing-based Systems

7 7 Mutual Exclusion with Known Delays Section 10.2 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

8 8 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 remainder code entry code critical section exit code Mutual Exclusion

9 9 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Implement a mutual exclusion algorithm for unknown number of processes with constant number of atomic registers and constant time complexity. Impossible for an asynchronous model, possible for timing-based model. Mutual Exclusion

10 10 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 NotationNotation await (condition) == while (not condition) do skip od

11 11 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Fischer’s algorithm process pi program 1repeat 2await(x = 0) 3x = i 4 delay(  ) 5until x = i 6critical section 7x = 0 // not fast 1repeat 2await(x = 0) 3x = i 4 delay(  ) 5until x = i 6critical section 7x = 0 // not fast 0 x await (condition) == while (not condition) do skip od

12 12 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Fischer’s algorithm process pi program 1repeat 2await(x = 0) 3x = i 4 delay(  ) 5until x = i 6critical section 7x = 0 // not fast 1repeat 2await(x = 0) 3x = i 4 delay(  ) 5until x = i 6critical section 7x = 0 // not fast 0 x Can we replace the order of these two lines?

13 13 Fast Mutual Exclusion with Known Delays Section 10.3 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

14 14 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 A fast algorithm process pi program 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 00 xyz

15 15 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 00 xyz Why delay(2  ) and not delay(3  ) ? A fast algorithm process pi program

16 16 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 00 xyz Can we replace this statement with: y = 0 ? A fast algorithm process pi program

17 17 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 00 xyz Can we replace the order of the last two lines? A fast algorithm process pi program

18 18 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 00 xyz Can we replace the order of these two lines? A fast algorithm process pi program

19 19 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 00 xyz Can we replace this statement with: if y  0 then goto start fi ? A fast algorithm process pi program

20 20 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 1 start: x = i ; 2 await (y = 0) 3 y = i 4 if x  i then delay(2  ) 5 if y  i then goto start fi 6 await (z = 0) 7 else z = 1 fi 8 critical section 9 z = 0 ; 10 if y = i then y = 0 fi 00 xyz Can we replace this statement with: if z  0 then goto start fi ? A fast algorithm process pi program

21 21 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 PropertiesProperties  Mutual exclusion & Deadlock freedom  In the absence of contention only 8 steps are required  In the presence of contention, delay of 2  used to resolve contention  space: 3 registers  work for unknown # of processes  Mutual exclusion & Deadlock freedom  In the absence of contention only 8 steps are required  In the presence of contention, delay of 2  used to resolve contention  space: 3 registers  work for unknown # of processes

22 22 Consensus with Known Delays Section 10.4 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

23 23 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 ConsensusConsensus 1 1 0 1 1 1 1 1 0 1 1 1 0 1 requirements:  validity  agreement  termination + Wait-freedom requirements:  validity  agreement  termination + Wait-freedom Thm: There is no asynchronous solution to the problem using atomic registers only.

24 24 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Wait-free Consensus Each process has input  {0,1} and has to output a value  {0,1}, such that: Agreement: all output the same value. Validity: output should be the input of some process termination: + wait-free Each process has input  {0,1} and has to output a value  {0,1}, such that: Agreement: all output the same value. Validity: output should be the input of some process termination: + wait-free Recall that there is no solution to the problem using atomic registers only.

25 25 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Known delay: Consensus process pi with input in.i 1 if x =  then x = in.i fi 2 delay(  ) 3 decide (x) 1 if x =  then x = in.i fi 2 delay(  ) 3 decide (x)  x

26 26 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) fi 4 decide (y) 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) fi 4 decide (y) 00  Known delay: Fast Consensus process pi with input in.i x[0]x[1]y

27 27 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) fi 4 decide (y) 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) fi 4 decide (y) 00  x[0]x[1]y Can we replace the order of these two lines? Known delay: Fast Consensus process pi with input in.i

28 28 Fast Consensus with Unknown Delays Section 10.5 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

29 29 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(round) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). // delay(r) ~ for j=1 to r do skip od 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(round) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). // delay(r) ~ for j=1 to r do skip od  0 0 1in.i  x yroundv out Unknown delay: Fast Consensus process pi with input in.i

30 30 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(round) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). // delay(r) ~ for j=1 to r do skip od 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(round) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). // delay(r) ~ for j=1 to r do skip od Can processes decide on conflicting values if the delay statement is deleted? Unknown delay: Fast Consensus process pi with input in.i

31 31 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(round) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). // delay(r) ~ for j=1 to r do skip od 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(round) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). // delay(r) ~ for j=1 to r do skip od Unknown delay: Fast Consensus process pi with input in.i Can we replace the order of these two lines?

32 32 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(round) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). // delay(r) ~ for j=1 to r do skip od 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(round) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). // delay(r) ~ for j=1 to r do skip od Unknown delay: Fast Consensus process pi with input in.i Can we replace with delay (2 x round) ?

33 33 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 A comment about the previous consensus algorithm for the unknown delay model delay() number of rounds time round  O (  ^2) round ! O (log  / log log  ) O (  log  / log log  ) Tight lower bound (for problem):  (  log  / log log  )

34 34 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Conclusions from consensus Model Time Asynchronous: impossible Unknown:  (  log  / log log  ) Known:  (  )

35 35 Computing in the Presence of Timing Failures Additional materiel not from the book Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Based on the paper: Computing in the presence of timing failures. G. Taubenfeld. The 26th International Conference on Distributed Computing Systems, July 2006, Lisboa, Portugal. The paper can be downloaded from: http://www.faculty.idc.ac.il/gadi/MyPapers/2006T-timingFailures.pdf

36 36 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Computing in the Presence of Timing Failures A timing failure refers to a situation where the timing constraints of a timing-based system are not met. In particular, a timing failure occurs when it takes more than  time units for a process to execute a statement which involves an access to a shared memory location. A timing failure refers to a situation where the timing constraints of a timing-based system are not met. In particular, a timing failure occurs when it takes more than  time units for a process to execute a statement which involves an access to a shared memory location.

37 37 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Timing Failures: What can happen? SynchronousAsynchronousPartially synchronous Incorrect behavior Satisfies safety but not liveness properties Correct but inefficient What if the timing failure is transient ? Incorrect behavior Satisfies safety but not liveness properties Correct but inefficient What if the timing failure is transient ? less powerful realistic extremely powerful unrealistic

38 38 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Goal: Tolerating Timing Failures Many systems exhibit a significant degree of synchrony in practice, but few guarantee to do so  Exploiting synchrony when it is available, but  In any case guaranteeing correctness regardless of the timing behavior of the system A detailed definition later...

39 39 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014  The value of  can be huge m page faults m memory contention m preemption  Use optimistic evaluation for    timing failures, but its ok!  The value of  can be huge m page faults m memory contention m preemption  Use optimistic evaluation for    timing failures, but its ok! Are Timing-based Algorithms practical ?... M PP Simple Shared Memory

40 40 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Computing in the Presence of Timing Failures An algorithm is resilient to timing failures, w.r.t. time complexity T if it satisfies the following requirements, Stabilization. After a transient timing failure has terminated, all the properties immediately hold, assuming no more failures occur in the future. Furthermore, all the safety properties always hold (even during timing failures). Efficiency. In the absence of timing failures the time complexity of the algorithm should be T. Convergence. A finite number of time units after all timing failures stop, the time complexity is again T. An algorithm is resilient to timing failures, w.r.t. time complexity T if it satisfies the following requirements, Stabilization. After a transient timing failure has terminated, all the properties immediately hold, assuming no more failures occur in the future. Furthermore, all the safety properties always hold (even during timing failures). Efficiency. In the absence of timing failures the time complexity of the algorithm should be T. Convergence. A finite number of time units after all timing failures stop, the time complexity is again T.

41 41 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) fi 4 decide (y) 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) fi 4 decide (y) 00  Fast Timing-base Consensus process pi with input in.i x[0]x[1]y Can it tolerate timing failures? No.

42 42 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) else decide (y) fi 4 in.i = y 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) else decide (y) fi 4 in.i = y 00  x[0]x[1]y 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) else decide (y) fi 4 in.i = y 1 x[in.i] = 1 2 if y =  then y = in.i fi 3 if x[1– in.i] = 1 then delay(  ) else decide (y) fi 4 in.i = y Consensus in the Presence of Timing Failures process pi with input in.i round 1 round 2

43 43 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(  ) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(  ) 6 v = y[round] 7 round = round + 1 fi od 8 output(out).  0 0 1in.i  x yroundv out Consensus in the Presence of Timing Failures process pi with input in.i

44 44 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(  ) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). 1 while out =  do 2x[round,v] = 1 3if y[round] =  then y[round] = v fi 4if x[round, 1-v] = 0 then out = v 5 else delay(  ) 6 v = y[round] 7 round = round + 1 fi od 8 output(out). Consensus in the Presence of Timing Failures process pi with input in.i Can processes decide on conflicting values without the delay? NO.

45 45 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 PropertiesProperties  In the absence of timing failures, each process decides after at most c  time units.  When there are no more timing failures after round r, decision is made by round r+1.  Wait-free: can tolerate any number of process failures.  No need to know the number of processes.  Validity, agreement, termination.  In the absence of timing failures, each process decides after at most c  time units.  When there are no more timing failures after round r, decision is made by round r+1.  Wait-free: can tolerate any number of process failures.  No need to know the number of processes.  Validity, agreement, termination.

46 46 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1repeat 2await(x = 0) 3x = i 4 delay(  ) 5until x = i 6critical section 7x = 0 1repeat 2await(x = 0) 3x = i 4 delay(  ) 5until x = i 6critical section 7x = 0 Mutual Exclusion in the Presence of Timing Failures 1entry section of A 2critical section 3exit section of A 1entry section of A 2critical section 3exit section of A Fischer’s algorithm Let A be a fast starvation-free algorithm

47 47 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 1repeat 2await(x = 0) 3x = i 4 delay(  ) 5until x = i 6 7critical section 8 9if x = i then x = 0 fi 1repeat 2await(x = 0) 3x = i 4 delay(  ) 5until x = i 6 7critical section 8 9if x = i then x = 0 fi Mutual Exclusion in the Presence of Timing Failures process pi with input in.i entry section of A exit section of A A is a fast starvation-free algorithm

48 48 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Time complexity The longest time interval where some process is in its entry code while no process is in its critical section. (assuming there is an upper bound of  time units for step time in the entry or exit code and no lower bound.) The longest time interval where some process is in its entry code while no process is in its critical section. (assuming there is an upper bound of  time units for step time in the entry or exit code and no lower bound.) time

49 49 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The Algorithm is resilient to Timing Failures  Stabilization: Satisfies mutual exclusion & deadlock freedom (before, during & after timing failures).  Efficiency: In the absence of timing failures, time complexity is c .  During timing failures, time complexity is the complexity of M + c   Convergence: Guaranteed to converge, after timing failures stop.  Stabilization: Satisfies mutual exclusion & deadlock freedom (before, during & after timing failures).  Efficiency: In the absence of timing failures, time complexity is c .  During timing failures, time complexity is the complexity of M + c   Convergence: Guaranteed to converge, after timing failures stop.

50 50 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 SummarySummary  Weaknesses of the asynchronous model  Timing-based models (known, unknown)  Algorithms (consensus, mutex)  Weaknesses of the asynchronous model  Timing-based models (known, unknown)  Algorithms (consensus, mutex) Are all the impossibility results for asynchronous systems important, given that they do not hold for the known-delay model and the unknown-delay model ? Are all the impossibility results for asynchronous systems important, given that they do not hold for the known-delay model and the unknown-delay model ? Is these timing models a better way out of the FLP dilemma ? (FLP == the impossibility result for consensus in the presence of one faulty process, proved in Section 9.5) Is these timing models a better way out of the FLP dilemma ? (FLP == the impossibility result for consensus in the presence of one faulty process, proved in Section 9.5)

51 51 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The End


Download ppt "1 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization."

Similar presentations


Ads by Google