edited by
17,578 views
25 votes
25 votes

An operating system contains $3$ user processes each requiring $2$ units of resource $R$. The minimum number of units of $R$ such that no deadlocks will ever arise is

  1. $3$
  2. $5$
  3. $4$
  4. $6$
edited by

6 Answers

0 votes
0 votes
Let use the formulae,

n*k - (n - 1)  or   (Total Number Process * Total Number of Resource ) - (Total Process -1 )

 

then,

= 3*2 - (3 - 2)

= 4

 

For Example : There are 8 process and each require 2 resources to complete the task. So the Minimum number of resource which guarantee the dead lock free is 10

=8*2 -(8-2)

=10
0 votes
0 votes

Step(1)Create circular wait of processes where each process in the set is waiting for other to complete. How this is done is, give each process exactly 1 less the maximum number of resource it demands.

$P_1$ $P_2$ $P_3$
1 1 1

Now every process in the set is holding and waiting and the circular wait is created. Deadlock!!

Step (2). Now give one extra resource, so that any one process is able to complete, hence circular wait is broken.!

so 3+1=4 resources required to never fall into a deadlock

and Maximum 3 resources can be there for the deadlock to happen.

Answer:

Related questions

51 votes
51 votes
14 answers
2
24 votes
24 votes
3 answers
3
Kathleen asked Sep 29, 2014
5,718 views
The correct matching for the following pairs is:$$\small \begin{array}{cl|cl}\hline \text{(A)} &\text{Disk Scheduling} & \text{(1)} &\text{Round robin} \\\hline \text{...
32 votes
32 votes
2 answers
4
Kathleen asked Sep 29, 2014
8,584 views
I/O redirectionimplies changing the name of a filecan be employed to use an existing file as input file for a programimplies connecting $2$ programs through a pipeNone of...