7.6
Distributed Systems

Vector Clocks

Track causality in distributed systems with vector timestamps, message passing, and concurrency detection

Presets
1.0x
A[0, 0, 0]B[0, 0, 0]C[0, 0, 0]InternalSSendRReceiveMessage
Current Vector Clocks
A
[0, 0, 0]
0 events
B
[0, 0, 0]
0 events
C
[0, 0, 0]
0 events
Metrics
Total Events
0
Messages
0
Concurrent
0
Causal
0
A
0
B
0
C
0
Event Log0
Press Play or use manual controls
How Vector Clocks Work

Internal event: Process increments its own entry in the vector clock. For process B with clock [1, 2, 0], an internal event yields [1, 3, 0].

Send: Increment own entry, then attach the updated vector clock to the outgoing message.

Receive: Take element-wise max of the local clock and the received clock, then increment own entry. This captures causal knowledge from the sender.

Concurrent (||): Events where neither happens-before the other. Example: A:[2,0,0] and B:[0,1,0] are concurrent because neither dominates.

Happens-before (→): VC(a) < VC(b) means a causally precedes b. Every entry in a's clock is ≤ the corresponding entry in b's clock, with at least one strictly less.

Comparison rules: If VC(a) < VC(b), a happened before b. If VC(b) < VC(a), b happened before a. Otherwise, a and b are concurrent.