Lamport & Vector Clocks
7 min read.
Step through messages between three processes as Lamport and vector clocks tick, see which events are concurrent, and watch total order broadcast keep nodes in step.
Think of it this way: A Lamport clock is a page number in a shared story: when you get a letter marked page 40, your next page is at least 41. A vector clock is a list of how many letters you have read from each friend, so you can tell whether someone wrote without having read your last letter.
Three processes, no shared clock. Each keeps one counter and adds 1 at every event.
Check your understanding
Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.
Before, after or concurrent?
Compare the first vector clock with the second in each pair.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
First happened before
Drop items hereFirst happened after
Drop items hereConcurrent
Drop items hereQuiz
8 questionsA process has Lamport clock 2 and receives a message stamped 6. What is its clock after the receive?
Done with this lesson?
Sign in free to keep your progress, streak and quiz scores.