In computer science, the happened-before relation (denoted:
This involves ordering events based on the potential causal relationship of pairs of events in a concurrent system, especially asynchronous distributed systems.
[1] The happened-before relation is formally defined as the least strict partial order on events such that: If two events happen in different isolated processes (that do not exchange messages directly or indirectly via third-party processes), then the two processes are said to be concurrent, that is neither
[2] If there are other causal relationships between events in a given system, such as between the creation of a process and its first event, these relationships are also added to the definition.
Like all strict partial orders, the happened-before relation is transitive, irreflexive (and vacuously, asymmetric), i.e.: Let us observe that the asymmetry property directly follows from the previous properties: by contradiction, let us suppose that
This allows one to design algorithms for mutual exclusion, and tasks like debugging or optimising distributed systems.