in Operating System
5,172 views
7 votes
7 votes

Consider a system having "n" resources of same type. These resources are shared by 3 processes, A, B, C. These have peak demands of 3, 4, and 6 respectively. For what value of "n" deadlock won't occur

  1. 15
  2. 9
  3. 10
  4. 13
in Operating System
5.2k views

1 comment

The minimum number of resources such that deadlock never occurs is 11. So in the question two options satisfy this condition ie, 13 and 15. How to choose option in exam in this case?
0
0

2 Answers

15 votes
15 votes
Best answer
Apply PigeonHole principle.
value of n will be (3-1) + (4-1) + (6-1) + 1= 11
but here no option which is 11.

now lets try 2nd way.

it may possible that after completion of task processes don't want to release resource (Yes it is not written any where that processes must release resources after Execution) so we can think like this also.

To overcome this situation we have to allocate all required resources to each process at very stating. i.e. 3+4+6 = 13

13 satisfy both cases. so in worst it should be answer.
selected by

4 Comments

Still why take risk - always choose the largest value as answer.
2
2
Arjun sir shouldn't be 13. i had edited my answer. check once.
0
0
the Question is asking for n and didn't mention minimum, right ? then 13 and 15 both can lead to no deadlock and answer must be A & D.
0
0
1 vote
1 vote
Option C will be the right opton for it.Such problem is explained earlier.
Answer:

Related questions