DISTRUBUTED SYSTEM NOTES,IOE, TU,BCA
LOGICAL CLOCK IN DISTRIBUTED SYSTEM
A logical clock in a distributed system is a mechanism used to order events and capture causality without relying on physical time. It helps in synchronizing events across different nodes to ensure a consistent and coherent sequence of operations. There are two main types of logical clocks: Lamport timestamps and vector clocks.
Lamports Logical Clock
Lamport's Logical Clock is a mechanism used in distributed systems to order events in a way that respects causality, even when there is no global physical clock. This concept was introduced by Leslie Lamport in 1978 and plays a critical role in ensuring the consistency and coordination of distributed systems.
To synchronize logical clocks, Lamport defined a relation called happens-before.The expression a ->b is read as ‘a happens before b’ and means that all processes agree that event a occurs then event b occurs.From the definition of the happened-before relation, the clock condition mentioned above is satisfied if the following conditions hold:
The algorithm follows some simple rules: