Professional Documents
Culture Documents
on
Critical Section Problem
+
The Critical-Section Problem
Solution to Critical-Section
Problem
1.
2.
3.
Mutual Exclusion
Progress
Bounded Waiting
+
Peterson Algorithm
do{
do{
flag[i] = true;
turn = j;
flag[j] = true;
turn = i;
flag[j] = false;
remainder section;
} while(true);
+
Mutual Exclusion
Occurs
There
During
+
Progress
If
If
+
The bounded waiting
requirement
the
turn->
variable.
Process
Outermost
Wait.your
turns up.
Let the next
process enter
its critical
section.
THANK
YOU