137 views
3 3 votes

A system contains three distinct critical resources: $R_1,R_2,R_3$ shared by four processes.

Their resource requirements are:

  • $P_1$ requires $R_1$ and $R_2$.
  • $P_2$ requires $R_2$ and $R_3$.
  • $P_3$ requires $R_1$ and $R_3$.
  • $P_4$ requires only $R_2$.

If a deadlock occurs, what is the minimum number of processes that can be deadlocked?

  1. $1$
     
  2. $2$
     
  3. $3$
     
  4. $4$

1 Answer

0 0 votes

A single process cannot form a circular resource dependency here.

Now check whether two processes can deadlock.

$P_1$ and $P_2$ have only $R_2$ in common.

$P_1$ does not require $R_3$, and $P_2$ does not require $R_1$.

So they cannot hold different resources required by each other to form a two-process cycle.

Similarly:

  • $P_1$ and $P_3$ share only $R_1$.
  • $P_2$ and $P_3$ share only $R_3$.

No pair can construct a circular wait.

$P_4$ requires only $R_2$. If it obtains $R_2$, it has no second resource to wait for. If it waits for $R_2$, it does not contribute another held resource to a cycle.

But three processes can deadlock:

  • $P_1$ holds $R_1$ and waits for $R_2$.
  • $P_2$ holds $R_2$ and waits for $R_3$.
  • $P_3$ holds $R_3$ and waits for $R_1$.

This produces:

$P_1\rightarrow P_2\rightarrow P_3\rightarrow P_1$.

Therefore the minimum number is $\boxed{3}$

Answer:
Position:
Show:

Related questions

3 3 votes
1 1 answer
113
113 views
GO Classes asked Aug 21
113 views
In a multiprocessor system with preemptive scheduling, three processes $P_1,P_2,P_3$ share resources $R_1,R_2,R_3$.$P_1$ and $P_2$ compete for $R_1$. $P_2$ and $P_3$ comp...
3 3 votes
1 1 answer
104
104 views
GO Classes asked Aug 21
104 views
In the wait-for graph for transactions $A$ through $G$ shown below, which option lists all transactions that are in a permanent waiting state?Here, an edge $X \to Y$ in t...
2 2 votes
1 1 answer
141
141 views
GO Classes asked Aug 21
141 views
Four processes have the following state:$$\begin{array}{c@{\qquad\qquad}c}\textit{Current Allocation} & \textit{Current Request} \\ \begin{array}{|c|cc|}\hline\text{Proce...
2 2 votes
1 1 answer
124
124 views
GO Classes asked Aug 21
124 views
Suppose system $S_1$ uses a deadlock avoidance method, whereas system $S_2$ uses a deadlock detection method.Consider the following statements:$S_1$ restricts the order i...