edited by
18,209 views
45 votes
45 votes

Consider the methods used by processes $P1$ and $P2$ for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables $S1$ and $S2$ are randomly assigned.
$$\begin{array}{|l|l|}\hline \textbf{Method used by P1}  &  \textbf{Method used by P2}  \\ \hline  \text{while (S1 == S2);} & \text{while (S1 != S2);} \\  \text{Critical Section} & \text{Critical Section} \\  \text{S1 = S2;} & \text{S2 = not(S1);} \\\hline \end{array}$$
Which one of the following statements describes the properties achieved?

  1. Mutual exclusion but not progress
  2. Progress but not mutual exclusion
  3. Neither mutual exclusion nor progress
  4. Both mutual exclusion and progress
edited by

6 Answers

0 votes
0 votes
Here Mutual Exclusion is satisfied as here only one process can enter critical section at a particular time.

Suppose, $S1=1$ and $S2=0$ then $P2$ will be interested to enter critical section.But not $P1$.

Progress is not there as here $P2$ need to leave the critical section then only $P1$ can enter. But it might not happen so, condition of progress not satisfied.

$Ans: A$
0 votes
0 votes

To check mutual exclusion we need to check that atmost one process should enter the citical section and when one process is in the critical section then other process cant enter, Here we can see that S1 and S2 are mutually exclusive cases. Checking manually also when one process is in the CS then other cant enter. Hence Mutual exclusion is satisfied. 

To check progress we need to check if two or more processes want to enter the CS then atleast one process should enter, also if the process can also enter individually if they are interested without interference of other process.

In this question indvidual entering of process in the CS can be a problem, hence not satisfying Progress

So, Mutual exclusion but not progress

Answer:

Related questions

61 votes
61 votes
6 answers
1
go_editor asked Sep 30, 2014
26,803 views
The following program consists of $3$ concurrent processes and $3$ binary semaphores. The semaphores are initialized as $S0=1, S1=0$ and $S2=0.$$$\begin{array}{|l|l|}\hli...
23 votes
23 votes
2 answers
3
41 votes
41 votes
2 answers
4