Answer to 6.1 Version 0 |
|
👤 Author: by fmissy 2017-01-08 11:30:07 |
The Critical-Section problem has three requirements (1)mutual exclusion, (2)progress, and (3)bounded waiting;
(1) mutual exclusion:
In the figure 6.25, we can see that only when flag[j]=false or turn=i, Pi get in critical-secction. If P1 and p2 are in the critical-section at the same time, so flag[0]=flag[1]=true. However, the value of turn is 0 or 1, so it must have one process that get out of “while”, and get into critical-section, and
Please login to reply. Login