Skip to content

gauravchak/vector-clocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vector-clocks

We are given a set of events per server. For example:

[
    [(2, 1), (1, 2)],
    [(0, 0), (1, 1), (2, 2), (1, 4)],
    [(0, 0), (2, 4)]
]

Timing rules:

  • All server timestamps start with 0
  • Local Event: The timestamp of the server increments
  • Send : The timestamp of the server is incremented and a message is sent with that timestamp.
  • Recv : The timestamp of the server is set to 1 plus higher of the timestamp of the server before this event and the timestamp of the received message.

The output is meant to be the event timestamps on that server. For the input above, the correct output would be: {{3, 4}, {1 , 2 , 5 , 6}, {1 , 7}}. Here, the first vector {3, 4} are the timestamps of the two events of S0 for instance.

About

Sample Go and Rust implementation of Vector Clocks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published