10.2. Mutual exclusion

In a system many processors are simultaneously fetching and executing instructions of stored programs. The following facts relating to the conventional machine level of a computer can be asserted:

  • reading a memory location is indivisible or atomic (see Section 9.8);

  • writing a memory location is atomic.

There can be arbitrary interleaving of machine instruction execution from concurrent computations and therefore arbitrary interleavings of memory accesses. The possibility should be considered that between any two instructions of one computation, any number of machine instructions of any other concurrent computation could be executed. It should also be noted that a high-level language statement, even a simple increment x++ ...

Get Operating Systems: Concurrent and Distributed Software Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.