Mathematically, there is a partial order called the "happens-before" order over all actions performed by the program. The "happens-before" order subsumes the program order; if one action occurs before another in the program order, it will occur before the other in the "happens-before" order. In addition, releases and subsequent acquisitions of locks form edges in the happens-before graph. A read is allowed to return the value of a write if that write is the last write to that variable before the read along some path in the "happens-before" order, or if the write is not ordered with respect to that read in the "happens-before" order.