Definition
Critical Section
A critical section is a portion of a program that accesses a shared resource (global variable, data structure, hardware device). Execution must be protected by mutual exclusion to ensure data consistency.
A process alternates between non-critical segments and critical sections, where it accesses the critical region.
Requirements
Mutual Exclusion
At most one process executes in its critical section at any time.
Progress
If no process is in its critical section and some wish to enter, the selection must complete in finite time.
Bounded Waiting
There must exist a bound on the number of times other processes may enter their critical sections after a process has requested entry.