We are about to study mechanisms for enforcing mutual exclusion. Before we can understand the need for mutual exclusion or appreciate the software and hardware solutions for mutual exclusion we must understand concurrency and concurrent programming .
Concurrency is related to but different from parallelism.
The implementation of parallelism requires multiple processors but concurrent programs can be implemented on a single-processor architecture. Even when the processes being run are executed in a sequential batch mode, the operating system must be running concurrently with the active process in order to maintain control. Interleaving Interleaving is the mechanism that makes concurrency possible. The CPU executes one or more lines of one of the processes and then switches control to execute a few lines in another process. The OS maintains the status of each process in a process control block so that when control returns to a process, its execution can continue eventually to completion.