Mutual Exclusion in OS

Mutual Exclusion:

Only one process can execute its critical sections at any time. No other processes can be executed in their critical sections. If a process is executing in its critical section and there exist some processes that wish to enter their critical sections, then only those processes that are not executing in their remainder section can participate in the decision of which will enter its critical section next, and this selection can’t be postponed indefinitely. This process is called Mutual Exclusion.

Requirements for Mutual Exclusion:
1. Mutual Exclusion must be enforced, only one process at a time is allowed into its critical section among all processes that have critical sections for the same resource or shared object.

2. A process that halts in its non-critical section must do so without interfering with other processes.

3. It must not be possible for a process requiring access to a critical section to be delayed indefinitely, no deadlock or starvation can be allowed.

4. When no process is in a critical section, any process that requires entry to its critical section must be permitted to enter without delay.

5. No assumptions are made about relative process speeds or the number of processes.

6. A process remains inside its critical section for a finite time only.