70 likes | 75 Views
Concurrency and Scheduling (part 2). CPS210 Spring 2006. Papers. Time, clocks, and the ordering of events in a distributed system Leslie Lamport. Example. P. Q. R. p1. q1. r1. q2. p2. r2. q3. q4. p3. r3. q5. q6. p4. r4. q7. If C(a) < C(b) does a b?. P. Q. R. p1. q1.
E N D
Concurrency and Scheduling (part 2) CPS210 Spring 2006
Papers • Time, clocks, and the ordering of events in a distributed system • Leslie Lamport
Example P Q R p1 q1 r1 q2 p2 r2 q3 q4 p3 r3 q5 q6 p4 r4 q7
If C(a) < C(b) does a b? P Q R p1 q1 r1 q2 p2 r2 q3 q4 p3 r3 q5 q6 p4 r4 q7 p2, p3 concurrent with q3 Can’t assign same global time because p2p3
Example with tick marks P Q R p1 q1 r1 1 2 q2 p2 3 r2 q3 p3 q4 4 r3 5 q5 6 7 q6 p4 8 r4 q7
Example with straight tick marks P Q R p1 q1 r1 1 2 p2 q2 3 r2 p3 4 q3 5 q4 6 q5 r3 7 q6 p4 8 q7 r4
Exchanging clocks P Q R t=1 p1 q1 t=1 r1 t=1 q2 t=2 p2 t=2 r2 t=2 q3 t=3 q4 t=4 p3 t=3 r3 t=5 q5 t=5 q6 t=6 t=6 p4 r4 t=6 q7 t=7