var occupied, var blocked;
Entry section:
{
if(occupied)
{
blocked = blocked + 1;
sleep();
}
else
occupied = 1;
}
Exit section:
{
occupied = 0;
if(blocked)
{
wakeup(process);
blocked = blocked - 1;
}
}
which of the following is false?
(1) Mutual Exclusion is guaranteed (2) Deadlock free Algorithm (3) Progress is guaranteed (4)None
The answer given is (4)None . Reason- SInce both the variables are not initialized.
But in all conditions isn't Mutual exclusion never followed?
Since occupied=0 in exit section, a new process can come and enter the critical section; also one of the blocked processes which got woken up can also enter critical section- ie, 2 processes could be in critical section.
Please elaborate the correct working of this, for all the possible initial values of occupied and blocked.