 The basic rules imply that individual actions can be reordered, as long as the "as-if-serial" semantics of the thread are not violated, and actions that imply communication between threads, such as the acquisition or release of a lock, ensure that actions that happen prior to them are seen by other threads that see their effects.For example, everything that happens before the release of a lock will be seen to be ordered before and visible to everything that happens after a subsequent acquisition of that same lock.Mathematically, there is a partial order called the "happens-before" order over all actions performed by the program.