- 2070 Magh · 3 marks
Critical section; mutual exclusion
Short answer
A critical section is the code segment where a process accesses shared variables, files or tables. Mutual exclusion guarantees that only one process at a time executes its critical section for a given resource; others wait. A solution must also ensure progress and bounded waiting.
Define critical section and mutual exclusion with respect to multiple-process system.
Critical section
In a system of multiple cooperating processes, the critical section (critical region) is the segment of code in which a process accesses shared resources such as shared variables, files or tables. If two processes execute their critical sections on the same shared data at once, the result can be inconsistent (race condition). The structure of each process is:
do {
entry section // request permission
CRITICAL SECTION // access shared data
exit section // release permission
remainder section
} while (TRUE);
Mutual exclusion
Mutual exclusion is the property that only one process at a time may be inside its critical section for a given shared resource; all others who want to enter must wait until it leaves. Hence the shared data are updated consistently and race conditions are avoided.
A correct solution must also satisfy progress (a process outside the critical section must not stop others from entering) and bounded waiting (no process waits forever), and must not assume anything about relative speeds or the number of CPUs. Mutual exclusion is achieved with locks, Peterson's algorithm, TSL, semaphores and monitors.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Race condition; mutual exclusion requirements · Operating System, chapter 3
- Semaphore for mutual exclusion · Operating System, chapter 3
- Race condition; critical section approaches · Operating System, chapter 3
- Critical section problem; why execute quickly · Operating System, chapter 3
- Process synchronization, Peterson, TSL · Operating System, chapter 3
- Token ring mutual exclusion · Distributed System, chapter 6 · asked 3×
- Ricart-Agrawala mutual exclusion · Distributed System, chapter 6 · asked 2×
- Lamport algorithm for mutual exclusion · Distributed System, chapter 6
- Mutual exclusion via sleep and wake · Embedded System, chapter 6