A Lamport clock may be used to create a
partial ordering of events between processes. Given a logical clock following these rules, the following relation is true: if a \rightarrow b then C(a) , where \rightarrow\, means
happened-before. This relation only goes one way, and is called the
clock consistency condition: if one event comes before another, then that event's logical clock comes before the other's. The
strong clock consistency condition, which is two way (if C(a) then a \rightarrow b), can be obtained by other techniques such as vector clocks. Using only a simple Lamport clock, only a partial causal ordering can be inferred from the clock. However, via the
contrapositive, it's true that C(a) \nless C(b) implies a \nrightarrow b. So, for example, if C(a) \geq C(b) then a cannot have
happened-before b. Another way of putting this is that C(a) means that a may have
happened-before b, or be incomparable with b in the
happened-before ordering, but a did not happen after b. Nevertheless, Lamport timestamps can be used to create a
total ordering of events in a distributed system by using some arbitrary mechanism to break ties (e.g., the ID of the process). The caveat is that this ordering is artificial and cannot be depended on to imply a causal relationship. ==Lamport's logical clock in distributed systems==