- In the critical section problem,
n processes repeatedly execute a critical and then noncritical section
of code, and having the form:
process CS[i=1 to n]
while (true)
{
entry protocol;
critical section;
exit protocol;
noncritical section;
}
- Each critical section is a sequence of statements that access some shared object
- Each noncritical section is another sequence of statements
- It is assumed that a process that enters its critical section
will eventually exit; thus a process may terminate only outside its critical
section
The task is to design entry and exit protocols satisfying the following properties:
- Mutual exclusion - at
most one process at a time is executing its critical section (safety
property)
- Absence of Deadlock (Livelock)
- if two or more processess are trying to enter their critical sections,
at least one will succeed (safety property)
- Absence of Unnecessary Delay
- if a process is trying to enter its critical section and the other processes
are executing their noncritical sections or have terminated, the first
process is not prevented from entering its critical section (safety
property)
- Eventual Entry - a process
that is attempting to enter its critical section will eventually succeed
(liveness property)