Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

1 1 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld Chapter 1 Introduction Version: June 2014

2 2 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 A note on the use of these power-point 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 power-point 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: , 1 st edition Synchronization Algorithms and Concurrent Programming ISBN: , 1 st edition To get the most updated version of these slides go to:

3 3 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 SynchronizationSynchronization  Type of synchronization m Contention m Coordination  Why synchronization is Difficult? m Easy between humans m Communication between computers is restricted reading and writing of notes sending and receiving messages  Type of synchronization m Contention m Coordination  Why synchronization is Difficult? m Easy between humans m Communication between computers is restricted reading and writing of notes sending and receiving messages

4 4 Too Much Milk Section Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

5 5 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The Too-Much-Milk Problem TimeAliceBob 5:00Arrive Home 5:05Look in fridge; no milk 5:10Leave for grocery 5:15Arrive home 5:20Arrive at groceryLook in fridge; no milk 5:25Buy milkLeave for grocery 5:30Arrive home; put milk in fridge 3:40Buy milk 3:45Arrive home; too much milk!

6 6 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Solving the Too-Much-Milk Problem Correctness properties  Mutual Exclusion: Only one person buys milk “at a time”  Progress: Someone always buys milk if it is needed Communication primitives  Leave a note (set a flag)  Remove a note (reset a flag)  Read a note (test the flag)

7 7 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Important Distinction  Safety Property m Nothing bad happens ever m Example: mutual exclusion  Liveness Property m Something good happens eventually m Example: progress  Safety Property m Nothing bad happens ever m Example: mutual exclusion  Liveness Property m Something good happens eventually m Example: progress

8 8 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Solution 1 Does it work? Alice if (no note) { if (no milk) { leave Note buy milk remove note } Bob if (no note) { if (no milk) { leave Note buy milk remove note } No, may end up with too much milk.  mutual exclusion progress

9 9 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Solution 2 Alice leave note A if (no note B) { if (no milk) {buy milk} } remove note A Bob leave note B if (no note A) { if (no milk) {buy milk} } remove note B Using labeled notes Does it work? No, may end up with no milk. mutual exclusion  progress

10 10 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Solution 3 Does it work? Alice leave note A while (note B) {skip} if (no milk) {buy milk} remove note A Bob leave note B if (no note A) { if (no milk) {buy milk} } remove note B No ! a timing assumption is needed mutual exclusion  progress Bob’s code is as before

11 11 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Is solution #3 a good solution? No  A timing assumption is needed!  Unfair to one of the processes  It is asymmetric and complicated  Alice is busy waiting – consuming CPU cycles without accomplishing useful work  A timing assumption is needed!  Unfair to one of the processes  It is asymmetric and complicated  Alice is busy waiting – consuming CPU cycles without accomplishing useful work

12 12 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Solution 3+ Does it work? Alice leave note A while (note B) {skip} if (no milk) {buy milk} remove note A Bob repeat leave note B if (note A) { remove note B; while (note A) {skip} } until (note B) if (no milk) {buy milk} remove note B Yes, BUT … mutual exclusion progress Alice code is as before BUT, Bob may forever get stuck in the repeat-until loop !!! Additional requirement [informal definition] Thirst-freedom: Nobody ever gets stuck forever. (Both Alice and Bob eventually complete their programs.)

13 13 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Solution 4 Using 4 labeled notes A1A2B2B1 the fridge’s door

14 14 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Solution 4 Notations color: there is a note A1A2B2 Alice’s turn B2 dotted line: there is no note solid line without color: we do not care if there is a note who will buy milk ? XX

15 15 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 A1A2B2 Alice’s turn A1A2B2B1 Alice’s turn A2B2B1 Bob’s turn A1A2B2B1 Alice’s turn A1A2B2B1 Bob’s turn A1A2B2B1 Bob’s turn Solution 4 B2 XX XX

16 16 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Alice leave A1 if B2 {leave A2} else {remove A2} while B1 and ((A2 and B2) or (no A2 and no B2)) {skip} if (no milk) {buy milk} remove A1 Bob leave B1 if (no A2) {leave B2} else {remove B2} while A1 and ((A2 and no B2) or (no A2 and B2)) {skip} if (no milk) {buy milk} remove note B1 Solution 4 A correct, fair, symmetric algorithm! mutual exclusion progress both Alice and Bob eventually complete their programs

17 17 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 A variant of Solution 4 A variant of Solution 4 The order of the first two statements is replaced Is it correct ? No, may end up with two milk.  mutual exclusion progress Alice if B2 {leave A2} else {remove A2} leave A1 while B1 and ((A2 and B2) or (no A2 and no B2)) {skip} if (no milk) {buy milk} remove A1 Bob if (no A2) {leave B2} else {remove B2} leave B1 while A1 and ((A2 and no B2) or (no A2 and B2)) {skip} if (no milk) {buy milk} remove note B1 MILK A1B2B1

18 18 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 QuestionQuestion Alice and Bob have a daughter C. Make it work for all the three of them. In Chapter 2, we solve a generalization of the too-much-milk problem, called the mutual exclusion problem, for any number of participants (not just two or three).

19 19 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 QuestionQuestion Process A for i = 1 to 5 { x:=x+1 } Process B for i = 1 to 5 { x:=x+1 } x is an atomic register, initially 0 Q: What are all the possible values for x after both processes terminate? A: 2 through 10 inclusive. 0 0

20 20 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The smallest value is A 0 1 B

21 21 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 QuestionQuestion Process A x:=x+1; x:=x+1 Process B x:=x+1; x:=x+1 Process C x:=10 x is an atomic register, initially 0 Q: What are all the possible values for x after the three processes terminate? A: 2,3,4,10,11,12,13,

22 22 The Coordinated Attack Problem Section Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

23 23 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The coordinated attack problem Blue army wins if both blue camps attack simultaneously Design an algorithm to ensure that both blue camps attack simultaneously Enemy 12 The problem is due to Jim Gray (1977)

24 24 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The coordinated attack problem Communication is done by sending messengers across the valley Messengers may be lost or captured by the enemy  Enemy 12

25 25 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The coordinated attack problem Theorem: There is no algorithm that solves the problem ! Assume to the contrary that such an algorithm exits. Let P be an algorithm that solves with fewest # of messages, when no message is lost. P should work even when the last messenger is captured. So P should work even if the last messenger is never sent. But this is a new algorithm with one less message. A contradiction. Proof:  The (asynchronous) model is too weak.

26 26 SynchronizationSynchronization Contention vs. coordination Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

27 27 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 SynchronizationSynchronization Contention m Too-much-milk (1) m mutual exclusion (2,3,4) m Concurrent Data Structures (4) m l-exclusion (6) m multiple resources: dinning philosophers (7) m readers & writer (8) m group-exclusions (8) m... Contention m Too-much-milk (1) m mutual exclusion (2,3,4) m Concurrent Data Structures (4) m l-exclusion (6) m multiple resources: dinning philosophers (7) m readers & writer (8) m group-exclusions (8) m... Coordination m The coordinated attack (1) m barrier synchronization (5) m Concurrent Data Structures (4) m producer-consumer (8) m Choice Coordination (8) m Consensus (data coordination) (9) m.... Coordination m The coordinated attack (1) m barrier synchronization (5) m Concurrent Data Structures (4) m producer-consumer (8) m Choice Coordination (8) m Consensus (data coordination) (9) m.... (The numbers refer to chapters in the book.)

28 28 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The first problem we cover in detail. A generalization of the too-much-milk problem. The mutual exclusion problem Chapters 2+3

29 29 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Blocking and Non-blocking Synchronization Concurrent data structures P1P2P3 data structure counter, stack, queue, link list Chapter 4

30 30 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 BlockingBlocking P1P2P3 data structure Chapter 4

31 31 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Non-blockingNon-blocking P1P2P3 data structure Chapter 4

32 32 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Coarse-Grained Locking Easier to program, but not scalable.

33 33 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Fine-Grained Locking Efficient and scalable, but too complicated (deadlocks, etc.).

34 34 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Barrier P1 P2 P3 P4 Barrier P1 P2 P3 P4 P1 P2 P3 P4 time Barrier Barrier Synchronization Chapter 5 four processes approach the barrier all except P4 arrive Once all arrive, they continue

35 35 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Example: Prefix Sum a begin bcdef a end a+ba+b+ca+b+c+d a+b+c +d+e a+b+c +d+e+f time

36 36 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Example: Sequential Prefix Sum a begin bcdef aa+bcdefa a+b+ca+b+c+def a end a+ba+b+ca+b+c+d a+b+c +d+e a+b+c +d+e+f aa+ba+b+cdefaa+ba+b+ca+b+c+d a+b+c+d+e f time

37 37 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Example: Parallel Prefix Sum a begin bcdef aa+bb+cc+dd+ee+faa+ba+b+ca+b+c+db+c+d+ec+d+e+f a end a+ba+b+ca+b+c+d a+b+c +d+e a+b+c +d+e+f time

38 38 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Example: Parallel Prefix Sum a begin bcdef aa+bb+cc+dd+ee+f aa+ba+b+ca+b+c+db+c+d+ec+d+e+f a end a+ba+b+ca+b+c+d a+b+c +d+e a+b+c +d+e+f barrier time

39 39 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 ConsensusConsensus requirements:  validity  agreement  termination Chapter 9

40 40 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Impossibility of Consensus with One Faulty Process What can be done?  Strong primitives.  Timing assumptions.  Randomizations. Theorem: There is no algorithm that solve the consensus problem using atomic read/write registers in the presence of a single faulty process. We give a detailed proof of this important result in Chapter 9 of the book.

41 41 Models of Computation Section 1.4 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

42 42 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Communication models of computation Concurrent programming  Shared memory m safe registers m atomic registers (read/write) m test&set m swap m compare-and-swap m load-link/store-conditional m read-modify-write m semaphore m monitor Concurrent programming  Shared memory m safe registers m atomic registers (read/write) m test&set m swap m compare-and-swap m load-link/store-conditional m read-modify-write m semaphore m monitor What is the relative power of these communication primitives? Answer: see Chapter 9.

43 43 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Communication models of computation Message passing m send/receive m multi-cast m broadcast m network topology Message passing m send/receive m multi-cast m broadcast m network topology Distributed message passing systems are not covered in the book

44 44 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Time models of computation Synchronous (CRCW, EREW) AsynchronousPartially synchronous What is the relative power of these timing models? Concurrent/ Distributed Parallel This book less powerful realistic extremely powerful unrealistic

45 45 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © M C M C PPPPPP Coherent Caching Distributed Shared Memory Simple Shared Memory Shared Memory Models models of computation MM

46 46 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 How many can fail ? m constant, n/3,... Wait-freedom, Non-blocking, Lock-freedom m what is it ? Self-stabilization m what is it ? How many can fail ? m constant, n/3,... Wait-freedom, Non-blocking, Lock-freedom m what is it ? Self-stabilization m what is it ? Fault-tolerance models of computation What can fail? m processes m shared memory m links Type of faults m crash m omission m Byzantine What can fail? m processes m shared memory m links Type of faults m crash m omission m Byzantine

47 47 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014  # of Processes: known, unknown, infinite Processes & Concurrency models of computation

48 48 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014  Processes: known, unknown, infinite  Concurrency: finite, bounded, unbounded Processes & Concurrency models of computation

49 49 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014  Processes: known, unknown, infinite  Concurrency: finite, bounded, unbounded  Faults: known, unknown Processes & Concurrency models of computation

50 50 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014  Processes: known, unknown, infinite  Concurrency: finite, bounded, unbounded  Faults: known, unknown  Participation: required / not required Processes & Concurrency models of computation

51 51 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Model Summary  Multiple processes (or threads)  Shared memory  Communication via shared objects  Unpredictable asynchronous delays  Cover all the classical synchronization problems  Focus more on principles, less on performance  Look for simple elegant short algorithms  Multiple processes (or threads)  Shared memory  Communication via shared objects  Unpredictable asynchronous delays  Cover all the classical synchronization problems  Focus more on principles, less on performance  Look for simple elegant short algorithms

52 52 Processes, Threads and Scheduling Section 1.5 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

53 53 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 TerminologyTerminology  Hardware m Processors  Software m Threads, processes  Sometimes OK to confuse them, sometimes not.  Scheduler  Hardware m Processors  Software m Threads, processes  Sometimes OK to confuse them, sometimes not.  Scheduler

54 54 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Processes and Threads A process is a program in execution Three processes each with one or more threads Kernel space User space Process 1 Threads Process 1 Kernel Threads Process One process with three threads In this book it is always ok to confuse between processes and threads.

55 55 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Processes and Threads A process is a program in execution  Shared by all threads in a process m Address space, global variables, open files,...  Private to each thread m Program counter, registers, stack.  User-level threads m Thread management is done by the application.  Kernel-level threads m Threads are managed by the kernel (but run in user space).

56 56 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 New Running terminated Ready Blocked admit event occurs CPU scheduler picks another process exit waits for I/O or other event CPU scheduler picks this process Five states a process can be in

57 57 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Processes and Scheduling 01n -1n Scheduler  Non-preemptive  the scheduler can not interrupt a running process.  Preemptive  the scheduler can interrupt a running process.

58 58 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Scheduling Algorithms  First-come-first-served schedules processes in the order they become ready.  Shortest-job-first schedule the process with the shortest time.  Priority scheduling schedule the process with the highest priority.  Round robin – each process is scheduled for a small number of time units (milliseconds).  Many other possibilities exist.  First-come-first-served schedules processes in the order they become ready.  Shortest-job-first schedule the process with the shortest time.  Priority scheduling schedule the process with the highest priority.  Round robin – each process is scheduled for a small number of time units (milliseconds).  Many other possibilities exist.

59 59 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Scheduling The Priority Inversion Problem  Process P1 with priority 5 enters its CS, and is preempted before releasing it.  Process P2 with priority 10 is scheduled but can not enter its CS and busy-waits.  Process P1 wants to release its critical section (to enable P2 to enter) but never gets scheduled.  Process P1 with priority 5 enters its CS, and is preempted before releasing it.  Process P2 with priority 10 is scheduled but can not enter its CS and busy-waits.  Process P1 wants to release its critical section (to enable P2 to enter) but never gets scheduled. In the sequel, we will assume that processes have the same priority.

60 60 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Problems Models read/write  Algorithms  Upper and lower bounds  Impossibility results  Simulations & Implementations Problems & Models barrier test&set swap LL/SC readers& writers consensus mutex

61 61 The Mutual Exclusion Problem The first problem we cover in detail A generalization of the too-much-milk problem The first problem we cover in detail A generalization of the too-much-milk problem Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014

62 62 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 remainder code entry code critical section exit code The problem is to design the entry and exit code in a way that guarantees that the mutual exclusion and deadlock-freedom properties are satisfied. The mutual exclusion problem

63 63 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 The mutual exclusion problem  Mutual Exclusion: No two processes are in their critical section at the same time.  Deadlock-freedom: If a process is trying to enter its critical section, then some process, not necessarily the same one, eventually enters its critical section.  Starvation-freedom: If a process is trying to enter its critical section, then this process must eventually enter its critical section.  Mutual Exclusion: No two processes are in their critical section at the same time.  Deadlock-freedom: If a process is trying to enter its critical section, then some process, not necessarily the same one, eventually enters its critical section.  Starvation-freedom: If a process is trying to enter its critical section, then this process must eventually enter its critical section. entry code exit code critical section remainder

64 64 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Question: true or false ? entry code of A exit code of A critical section remainder entry code of B exit code of B Algorithm C entry code exit code critical section remainder Algorithm AAlgorithm B

65 65 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Question: true or false ?  A and B are deadlock-free  C is deadlock-free.  A and B are starvation-free  C is starvation-free.  A or B satisfies mutual exclusion  C satisfies mutual exclusion.  A is deadlock-free and B is starvation-free  C is starvation- free.  A is starvation-free and B is deadlock-free  C is starvation- free. AA and B are deadlock-free  C is deadlock-free. AA and B are starvation-free  C is starvation-free. AA or B satisfies mutual exclusion  C satisfies mutual exclusion. AA is deadlock-free and B is starvation-free  C is starvation- free. AA is starvation-free and B is deadlock-free  C is starvation- free. entry code of A exit code of A critical section remainder entry code of B exit code of B Algorithm C

66 66 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Properties & complexity  Time complexity m Fast m Adaptive  Fairness m FIFO,...  Fault-tolerance  Local-spinning  Space complexity  Communication primitives  Time complexity m Fast m Adaptive  Fairness m FIFO,...  Fault-tolerance  Local-spinning  Space complexity  Communication primitives

67 67 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Complexity Measures  Counting steps m process step complexity m process time complexity m contention-free time complexity  Counting time units m system response time m process response time  Counting communications m distributed shared memory m coherent caching  Space complexity  Counting steps m process step complexity m process time complexity m contention-free time complexity  Counting time units m system response time m process response time  Counting communications m distributed shared memory m coherent caching  Space complexity

68 68 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 History of the mutex problem  1965 m Defined by Dijkstra m First solution by Dekker m General solution by Dijkstra  Fischer, Knuth, Lynch, Rabin, Rivest,...  1974 Lamport’s bakery algorithm  1981 Peterson’s solution  There are hundreds of published solutions  Lots of related problems E. W. Dijkstra (Photo by Hamilton Richards 2002)

69 69 Chapter 1 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Next Chapter In Chapter 2 we will start looking at basic solutions to the mutual exclusion problem using atomic registers. -- Gadi


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

Similar presentations


Ads by Google