Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cfm round rect
true,true,true
verticalsize25px
cornerstrue,true,true,true
horizontalsizeverticalsize25px
bgcolorfooter#a2c4c9
cornersizehorizontalsize25px
idcornersizeaw3ep6aj8nw15pxrows
id95se978wyjk
titleGeneration Clock with Martin Fowler
rowstrue,true,true

Generation Clock pattern is an example of a Lamport timestamp: a simple technique used to determine ordering of events across a set of processes, without depending on a system clock. Each process maintains an integer counter, which is incremented after every action the process performs. Each process also sends this integer to other processes along with the messages processes exchange. The process receiving the message sets its own integer counter by picking up the maximum between its own counter and the integer value of the message. This way, any process can figure out which action happened before the other by comparing the associated integers. The comparison is possible for actions across multiple processes as well, if the messages were exchanged between the processes. Actions which can be compared this way are said to be 'causally related'.

...