1 / 15

Synchronization

Synchronization. Chapter 5. Clock Synchronization. When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time. Physical Clocks (1). Computation of the mean solar day. Physical Clocks (2).

aldon
Download Presentation

Synchronization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Synchronization Chapter 5

  2. Clock Synchronization • When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time.

  3. Physical Clocks (1) • Computation of the mean solar day.

  4. Physical Clocks (2) • TAI (International Atomic Time) seconds are of constant length, unlike solar seconds. • Leap seconds are introduced when necessary to keep in phase with the sun.

  5. Clock Synchronization Algorithms • The relation between clock time and UTC (Universal Coordinated Time) when clocks tick at different rates.

  6. Cristian's Algorithm • Getting the current time from a time server.

  7. Cristian's Algorithm • Two problems: • Time must never run backwards, so backwards changes must be introduced gradually • update clock more slowly, for example • The delay for the time to get back may be large, and may be unpredictable (have to subtract propagation time) • Can measure several times and take average • Can omit values that exceed some threshold • Can take only the smallest, since this may be most representative of pur propagation time

  8. The Berkeley Algorithm • The time daemon asks all the other machines for their clock values • The machines answer • The time daemon tells everyone how to adjust their clock

  9. Lamport Timestamps • Three processes, each with its own clock. The clocks run at different rates. • Lamport's algorithm corrects the clocks.

  10. Lamport Timestamps • In 1978, Leslie Lamport noticed that for most applications synchronization is not important, but only that events be ordered in time. • Lamport defined some concepts: • 1) if a and b are events in the same process, and a occurs before b, then ab "a happened before b" • 2) if a is the event of sending a message and b is the event of • receipt of that message, then ab

  11. Lamport Timestamps • 3) if ab and bc then ac • Sometimes we draw a space-time diagram • time -----> • ---------- a ------------- b ------------------------- Process p1 • ------------- c ---- d -------------- g -------------- Process p2 • ------------------- e --------------------- f -------- Process p3

  12. Lamport Timestamps • ---------- a ------------- b ------------------------- Process p1 • ------------- c ---- d -------------- g -------------- Process p2 • ------------------- e --------------------- f -------- Process p3 • Suppose there are messages from c to b, d to f, and e to g • cb • df • eg • dg • cd ==> cf

  13. Lamport Timestamps • ---------- a ------------- b ------------------------- Process p1 • ------------- c ---- d -------------- g -------------- Process p2 • ------------------- e --------------------- f -------- Process p3 • two events a and b are said to be concurrent if it is not true that ab and it is not true that ba • d and e are concurrent

  14. Example: Totally-Ordered Multicasting • An application of Lamport timestamps: • Updating a replicated database and leaving it in an inconsistent state.

  15. Example: Synchronization with Event Counts and Sequencers • Paper by D. P. Reed and R. K. Kanodia, ``Synchronization with Eventcounts and Sequencers,'' Communications of the ACM, 22, 2 (February 1979), pp.115-123

More Related