Vector clocks
Vector Clocks is an algorithm for generating a total ordering of events in a distributed system. Just as in Lamport timestamps, interprocess messages contain the state of the sending processes logical clock. Vector clock of a system of N processes is an array of N logical clocks, one per process, a local copy of which is kept in each process with the following rules for clock updates:
- initialy all clocks are zero
- each time a process experiences an internal event, it increments its logical clock in the vector by one
- each time the process receives a message, it sets an element of the local clock vector to be the maximum of the value of that clock in the local copy and the value of that clock in the timestamp vector in the message.
The Vector clocks algorithm was developed by F. Mattern in 1989.
Categories: Computer science