in Operating System edited by
3,875 views
2 votes
2 votes
A system is  having 3 user process , each requiring 2 units of resource R  . WHAT IS  the minimum and maximum no. of units of   R  required such that no deadlock will occur ?
in Operating System edited by
3.9k views

1 comment

Maximum and Minimum value both are 4 .
0
0

3 Answers

8 votes
8 votes
Best answer

if we provide $3$ instances of $R$ then there is a possibility that following situation happens:

Where each process is allocated one instance and each process is waiting for one more instance of $R$. So definitely with $3$ instance deadlock may occur.

So we need to provide $1$ more instance of $R$ and then one of the processes can complete and release two instances of $R$ and subsequently other two processes can also finish their execution.

Therefore minimum $4$ instances of $R$ required.

selected by
by

4 Comments

thnku sir :)
0
0
There is no limit on maximum.It should be infinity.

If you say either 6 or 7 is max. Then 8 also satisfies No deadlock. 9 also satisfies No deadlock and so on...
0
0
@saswat

yes there is no limit on maximum .

maximum can be any value which is greater than 3 Resources .. among them minimum value is 4 .
2
2
2 votes
2 votes

Condition for deadlock is 
process * ( max need -1) = RESOURCES.  ..(i)

here process = 3 

each process requiring 2 units of resource R  so maximum need is 2

so according to (i)   3(2-1) = x ,  here x = maximum number of resources

3 = x

x =  3

so at max 3 resources require  to be in deadlock .

maximum resources require are 3 to be in deadlock so if we have (3+1 =4)  resources then there is no deadlock.

hence maximum value is also 4 .

edited by

4 Comments

3 user process , each requiring 2 units of resource R  so total resource is 3 * 2 = 6

calculated maximum need of resources required by a process is 3 .

total 6 resource to be needed to satisfy  deadlock , so increasing 1 resource dis satisfy deadlock condition.

more than 7 resources is also possible for dis satisfying deadlock but 7 is minimum value of maximum nunber of resources require.
0
0
3 user process,
Each process required 2 units of resources R (Given in the question) = Max need
Condition for deadlock
= process * ( max need -1) = RESOURCES
= 3 * (2 - 1)
= 3 * 1 = 3 = Resources.
So with 3 resources, we got Deadlock.
Increment the no. of resources by 1 there will be no deadlock.
So Minimum 4 resources for no deadlock.
2
2
Maximum is also 4 , see my edited answer now.
0
0
1 vote
1 vote
Question seems to be arbitrary. It should be maximum resources when we can have deadlock and minimum number of resources to not have deadlock.

Each process requiring 2 units of resource R  so maximum need is 2

so according to formula   3(2-1) = x ,  here x = maximum number of resources

x =  3

so at max 3 resources will be required to be in deadlock .

As maximum no of resources required is 3 to be in deadlock so if we have one more resource, (3+1 =4)  resources then there is NO deadlock.
Why?

Because in that case if all process have 1 resource and require 1 to complete. We have one free resource which we can allocate to any process, after which it will complete execution and release resources. Other process can now use released resources to complete.

Hence maximum value is also 4 for NO deadlock condition. .
edited by
Answer:

Related questions