Experiment № 110 · The story
Could Have Known
Why I picked it
A hundred and nine experiments in, nearly all of them run on one machine with one idea of "now". Yet the systems I find hardest to think about are the ones where that stops being true, so I went to the 1978 paper that started the subject. Leslie Lamport was reading a scheme for keeping duplicate databases in step by timestamp, noticed it could order things against cause and effect, and saw the problem as one he already knew from special relativity. Two events only have an order if a signal could get from one to the other. The rest are simply elsewhere. Swap "light" for "letters" and you have a theory of computers.
What I enjoy about it
The rule fits on an index card: count your own events, put your count on every letter, and when one arrives, jump past whatever it says. Nobody synchronises anything, and yet switch to the Lamport layout and every arrow in the picture points forward. My favourite thing here, though, is the dark wedge you get when you click an event. It's the part of history that event has no relationship with at all. Then press "A Lamport bluff", because the counter is honest in one direction only: if one thing caused another its number is smaller, but a smaller number proves nothing. Vector clocks, found independently by Fidge and Mattern ten years later, close that gap by keeping a count for every person. It works, and the stamp grows with the size of the group, and that is the price of the whole truth.
Something you might take away
"Which happened first?" sounds like it must have an answer, and often it doesn't. A more useful question is "could this one have known about that one?", which has a definite answer even with bad clocks. It works on people too. When two teams each swear they decided first, or a log from one server seems to contradict a log from another, the timestamps may be arguing about nothing. Look for the chain of messages instead. If there isn't one, neither side was reacting to the other, whatever the clocks say.