Hacker News new | ask | show | jobs
by mjb 1432 days ago
Yes, that's exactly right. Lamport clocks provide a partial ordering of events, based on the idea of "happened before". Specifically, Lamport defines the happens before operator →, such that within any one thread/process if a is done then b is done then a→b, and if a is one process sending c message and d is another process receiving the message then c→d. This allows a model where single-threaded processes communicate through messages, and allow us to reason about things like "if a could have caused b to happen, then a→b". Logical clocks are an extension of this model.

This is covered in the classic "Time, Clocks" paper (https://www.microsoft.com/en-us/research/uploads/prod/2016/1...). If you read exactly one distributed systems paper in your life, it should probably be this one.

1 comments

Bonus all-time great paper review: "Jim Gray once told me that he had heard two different opinions of this paper: that it’s trivial and that it’s brilliant. I can’t argue with the former, and I am disinclined to argue with the latter." (from Lamport at https://www.microsoft.com/en-us/research/publication/time-cl...).