Presentation is loading. Please wait.

Presentation is loading. Please wait.

6.2 Logical Clocks Kranthi Koya09/23/2015. Overview Introduction Lamport’s Logical Clocks Vector Clocks Research Areas Conclusion.

Similar presentations


Presentation on theme: "6.2 Logical Clocks Kranthi Koya09/23/2015. Overview Introduction Lamport’s Logical Clocks Vector Clocks Research Areas Conclusion."— Presentation transcript:

1 6.2 Logical Clocks Kranthi Koya09/23/2015

2 Overview Introduction Lamport’s Logical Clocks Vector Clocks Research Areas Conclusion

3 Introduction Clock Synchronization Working of Unix make program If time in source file input. c > object file input.o make knows that input.c has been changed since input.o was created, and thus input.c must be re- compiled. If output.c has time < output.o, no compilation is needed.

4 Introduction Implications of the lack of global time on the UNIX make program When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time.

5 Lamport’s Logical Clocks ‘happens-be-fore’ relation to synchronize logical clocks a ~ b is read "a happens before b" and means that all processes agree that first event a occurs, then event b occurs. a~ b is true when a and b are events in the same process, and a occurs before b. a ~ b is true if a is the event of a message being sent by one process, and b is the event of the message being received by another process

6 Lamport’s Logical Clocks To implement Lamport's logical clocks, each process Pi maintains a local counter G. 1. Before executing an event Pi executes Gf= G+1. 2. When process Pi sends a message m to Pj it sets timestamp ts (m) equal to G after having executed the previous step. 3. Upon the receipt of a message m, process lj adjusts its own local counter as 0f=max{0,ts(m)}, after which it then executes the first step and delivers the message to the application.

7 Lamport’s Logical Clocks

8 Totally Ordered Multicasting

9 Vector Clocks 1. Before executing an event (i.e., sending a message over the network, delivering a message to an application, or some other internal event), Pi executesVCj[I] ~ VCj[i]+1. 2. When process Pi sends a message m to lj, it sets m's (vector) time- stamp ts(m) equal to VCj after having executed the previous step. 3. Upon the receipt of a message m, process ij adjusts its own vector by setting VCj [k] ~ max {VCj [k], ts (m )[k]} for each k, after which it executes the first step and delivers the message to the application.

10 Vector Clocks Enforcing Casual Communication

11 Research Areas Logical Clocks in Distributed Systems

12 Research Areas Middle ware dealing with message ordering. Middle ware cannot tell what a message actually contains, only potential causality is captured. Example : Two messages from the same sender that are completely independent will always be marked as causally related by the middleware layer. Not all causality may be captured. Consider an electronic bulletin board. Suppose Alice posts an article. If she then phones Bob telling about what she just wrote, Bob may post another article as a reaction without having seen Alice's posting on the board. In other words, there is a causality between Bob's posting and that of Alice due to external communication. This causality is not captured by the bulletin board system.

13 Questions?

14 Thank you


Download ppt "6.2 Logical Clocks Kranthi Koya09/23/2015. Overview Introduction Lamport’s Logical Clocks Vector Clocks Research Areas Conclusion."

Similar presentations


Ads by Google