Minimum description length: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
 
en>BreakfastJr
m Copyedit + Changed a tagged link to go to where I assume it was always meant to go rather than a disambig page
Line 1: Line 1:
Hi, everybody! My name is Garfield. <br>It is a little about myself: I live in Switzerland, my city of Ziegelbrucke. <br>It's called often Northern or cultural capital of . I've married 2 years ago.<br>I have two children - a son (Jenifer) and the daughter (Jerald). We all like Golfing.<br><br>Visit my web blog ... [http://Www.aparus.ru/userinfo.php?uid=362569 Fifa 15 Coin generator]
In [[computer science]], the '''happened-before''' [[binary relation|relation]] (denoted: <math>\to \;</math>) is a relation between the result of two events, such that if one event should happen before another event, the result must reflect that. Even if those events are in reality executed out of order (usually to optimize program flow). This involves [[partially ordered set|ordering]] events based on the potential [[causal relationships|causal relationship]] of pairs of events in a concurrent system, especially [[asynchronous communication|asynchronous]] [[distributed systems]]. It was formulated by [[Leslie Lamport]].<ref>Lamport, Leslie (1978). [http://research.microsoft.com/en-us/um/people/lamport/pubs/time-clocks.pdf "Time, Clocks and the Ordering of Events in a Distributed System"], ''Communications of the ACM'', 21(7), 558-565.</ref> In Java specifically, a '''happens-before''' relationship is a guarantee that memory written to by statement A is visible to statement B, that is, that statement A completes its write before statement B starts its read.[http://docs.oracle.com/javase/tutorial/essential/concurrency/memconsist.html]
 
The happened-before relation is formally defined as the least [[strict partial order]] on events such that:
* If events <math>a \;</math> and <math>b \;</math> occur on the same process, <math>a \to b\;</math> if the occurrence of event <math>a \;</math> preceded the occurrence of event <math>b \;</math>.
* If event <math>a \;</math> is the sending of a message and event <math>b \;</math> is the reception of the message sent in event <math>a \;</math>, <math>a \to b\;</math>.
 
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 relation|transitive]]'', ''[[irreflexive relation|irreflexive]]'' and ''[[antisymmetric relation|antisymmetric]]'', i.e.:
* <math>\forall a, b, c</math>, if <math>a \to b\;</math> and <math>b \to c\;</math>, then <math>a \to c\;</math> (transitivity) ;
* <math>\forall a, a \nrightarrow  a</math> (irreflexivity) ;
* <math>\forall a, b,</math> if <math>a \to b\;</math> then <math>b \nrightarrow a</math> (antisymmetry).
 
The processes that make up a distributed system have no knowledge of the happened-before relation unless they use a [[logical clock]], like a [[Lamport clock]] or a [[vector clock]]. This allows to design algorithms for [[mutual exclusion]] and tasks like debugging or optimising distributed systems.
 
==See also==
* [[Java Memory Model]]
* [[Lamport timestamps]]
 
==References==
<references/>
 
{{DEFAULTSORT:Happened-Before}}
[[Category:Distributed computing problems]]

Revision as of 14:28, 21 January 2014

In computer science, the happened-before relation (denoted: ) is a relation between the result of two events, such that if one event should happen before another event, the result must reflect that. Even if those events are in reality executed out of order (usually to optimize program flow). This involves ordering events based on the potential causal relationship of pairs of events in a concurrent system, especially asynchronous distributed systems. It was formulated by Leslie Lamport.[1] In Java specifically, a happens-before relationship is a guarantee that memory written to by statement A is visible to statement B, that is, that statement A completes its write before statement B starts its read.[1]

The happened-before relation is formally defined as the least strict partial order on events such that:

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 antisymmetric, i.e.:

The processes that make up a distributed system have no knowledge of the happened-before relation unless they use a logical clock, like a Lamport clock or a vector clock. This allows to design algorithms for mutual exclusion and tasks like debugging or optimising distributed systems.

See also

References

  1. Lamport, Leslie (1978). "Time, Clocks and the Ordering of Events in a Distributed System", Communications of the ACM, 21(7), 558-565.