retagged by
721 views
1 votes
1 votes

A system is having user processes $P_1, P_2, \dots , P_N$ each requiring $Q_N, Q_{N-1}, \dots , Q_1$ number of resource instances of resource $R$. The minimum number of resource instances of $R$ to guarantee that deadlock will not occur is

  1. $NQ_N - N+1$
  2. $NQ_1 + N-1$
  3. $(Q_1 + Q_2 + … + Q_N) + N – 1$
  4. $(Q_1 + Q_2 + … + Q_N) + 1 – N$
retagged by

1 Answer

Best answer
4 votes
4 votes
The sum of the maximum requirement of the processes is $Q1 + Q2 + Q3 + ........ + Qn.$

Number of minimum resources are needed to ensure deadlock doesn't occur, sum all the maximum requirements of all the processes  and subtract 1 from each and then give one more resource any of the processes:

$[(Q1-1) + (Q2-1) + (Q3-1) + ........   + (Qn-1)] +1$

which is $(Q1 + Q2 + Q3 + ........  + Qn) - N + 1$

Hence, option (D) is correct!
selected by
Answer:

Related questions

2 votes
2 votes
2 answers
1
1 votes
1 votes
2 answers
3