Overview
Lamport Logical Clocks capture the causal happens-before relation (a -> b implies L(a) < L(b)) by incrementing a local counter on each event and updating L = max(L_local, L_msg) + 1 whenever a message is received.
Orders events across distributed processes without synchronized physical clocks using a monotonically increasing scalar logical counter.
Compact metadata for implementation and discovery.
Lamport Logical Clocks capture the causal happens-before relation (a -> b implies L(a) < L(b)) by incrementing a local counter on each event and updating L = max(L_local, L_msg) + 1 whenever a message is received.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1) per event
Average
O(1) per event
Worst
O(1) per event
Space
O(1) per process
Interactive Runtime & Memory Budget Calculator
Estimate wall-clock latency, operation count, and working memory for Lamport Logical Clocks across input scales.
11 ns
11 ns
128 B
a -> b implies L(a) < L(b)If event a causally precedes event b, its Lamport timestamp is strictly smaller.
L_recv = max(L_local, L_msg) + 1Advances the receiver's logical clock beyond both its local clock and the message timestamp.
This entry is part of the 1,000-algorithm concept catalog and provides high-level pseudocode, complexity bounds, and relationship links rather than a standalone in-browser benchmark engine.
Structured Execution Steps
Space-time diagram of distributed processes exchanging messages with scalar clock updates.
Introduced by Leslie Lamport in 1978 ('Time, Clocks, and the Ordering of Events in a Distributed System').
What each reference supports for this entry.
Foundational CACM paper defining the happens-before relation and logical clocks.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Vector clocks generalize Lamport clocks from a scalar to an N-element vector to detect concurrent events exactly.
Logical terms in Raft act as monotonic logical clocks across leader elections.