|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n |
The shared
variable turn
|
|
|
is initialized
(to 0 or 1)
|
|
|
|
before
executing any Pi
|
|
|
n |
Pi’s critical
section is
|
|
|
|
executed iff
turn = i
|
|
|
n |
Pi is busy waiting if Pj is
|
|
|
in CS: mutual
exclusion is
|
|
satisfied
|
|
|
n |
Progress
requirement is
|
|
|
|
not satisfied
since it
|
|
|
requires
strict alternation
|
|
|
of CSs
|
|
|
n |
Ex: if turn=0
and P0 is in
|
|
|
|
it’s RS, P1
can never
|
|
|
enter it’s CS
|
|
|
|