02-11-2012, 12:30 PM
Distributed Web Systems
Distributed Web.pdf (Size: 150.09 KB / Downloads: 24)
Clocks and timestamps
• Hardware clock:
– electronic device counting physical events occurring at a
definite frequency (e.g. oscillations in a quartz crystal)
• Software clock:
– At real time, t, the OS reads the time on the computer’s
hardware clock Hi(t)
– It calculates the time on its software clock
Ci(t)= aHi(t) + b
• Clock resolution:
– period between updates of the clock value: successive events
will correspond to different timestamps only if the clock
resolution is smaller than the time interval between the events
Synchronizing physical clocks
• External synchronization
– Clocks Ci of a set of N computers are synchronized with an external
authoritative time source S if:
– |S(t) - Ci(t) | < D for i = 1, 2, … N for all t in an interval of real time
– The clocks Ci are accurate to within the bound D.
• Internal synchronization
– The clocks Ci of a set of N computers are synchronized with one another if:
– | Ci(t) - Cj(t) | < D for i,j = 1, 2, … N for all t in an interval of real time
– The clocks Ci agree within the bound D.
Summary
• Knowing when an event occurred at a computer is
important for many functions in distributed systems
• No global time – instead synchronisation of clocks
within certain accuracy bounds
• Sometimes, the exact time in not important, but the
order of events is – use logical time. Also useful for
determining global state of a system.