Mutual exclusion

  • Authors:
  • Jean-Loup Baer

  • Affiliations:
  • -

  • Venue:
  • Encyclopedia of Computer Science
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

When several processes are executing simultaneously, it may happen that two (or more) of these processes want to access and modify the same data. For example, in a multiprogramming system a WRITE process (producer) and a READ process (consumer) might share the same buffer area, so that the consumer has to be protected from having its data garbled by the producer before the READ is completed. As a second example, in a system with multiple CPUs two processors can be idle and request a new task at the same time. If no precaution is taken, both will access the table where the list of waiting tasks is stored, and both may initiate the same task. To circumvent this problem, means must be provided to protect the shared data from disorderly changes. Such means are usually called mutual exclusion, or lockout. The portion of code in a process that accesses a shared area is called a critical section of that process.