Operating system - the definition and implementation of mutually exclusive

First, the process of mutually exclusive definitions

The so-called mutual exclusion refers to is a system resource, a process is using it, and the other would like to use its process must wait, but not both.
Mutual exclusion is a multi-channel programming system among existing process resource sharing relationship stems from constraints, also known as indirect constraint relations, it is mainly determined by the nature of the use of shared resources.

 

 

Second, the division of exclusive access

Third, follow the principle of mutual exclusion

Then let into the air: when there is no process in the exclusive zone, any right to use mutual exclusion zone can enter.
Busy waiting: the above two processes at the same time is not allowed to enter the exclusive zone, when the existing process enters a critical section, another trying to enter the critical section of the process must wait.
Etc. are limited: to process requests access should be guaranteed to enter the critical section (guaranteed not hungry) for a limited time.
Such as the right to make: when the process can not enter the critical section, should immediately release the processor, avoid busy waiting process.

Fourth, the software method to achieve mutually exclusive processes

 

Single notation:

Double check mark law:

 

 

 

After double-checking mark law:

 

Peterson's algorithm

 

Guess you like

Origin www.cnblogs.com/wkfvawl/p/11518628.html