The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+6 votes
2.1k views

What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes $P_1, P_2$ and $P_3$ running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.

  1. 3
  2. 7
  3. 9
  4. 10
in Operating System by Veteran (98.7k points) | 2.1k views

3 Answers

+14 votes
Best answer
consider the worst case all processes holding just one resource less than their completion(max need)

P1=2

P2=3

P3=4

TOTAL RESOURCE =9  now one more resource will ensure that any one of these process will execute and release all its resources

hence 9+1=10 resources will ensure there will not be deadlock hence ans is D
by Boss (48.2k points)
selected by
+1
what will be the ans if the condition changed to "deadlock always occur"....????
+2
deadlock may or may not occur when the resources are less than 10... i think deadlock always occur we cannot say as it depends on the allocation of resources...for example consider 2 resources if these two resources are allocated to p1..and no resources are allocated to p2,p3...there is no deadlock...but no process completes also.
0
? i did not get after 9 , how u wrote total resources =10

plz explain
0
it is just a case when resources becomes 10  there is no deadlock
0
beacuse for maximum no for happing dead lock if  we provided resource

p1=2

p2=3

p3=4

2+3+4=9 means if we have 9 process so there is chance that deadlock may happen thats why min no will be 10 resource we can ensure that there will no deadlock
+3 votes

Option D will right option for it.

We have processes like P1,P2 and P3 now assign each one of them 2,3 and 4 units.This is condition for deadlock if we assign one more unit to any one of the processes then deadlock will be broken .Therefore minimum resourses required is 10.

by Loyal (9.7k points)
+3 votes
Short trick for these kind of questions-

subtract 1 from "all" max demands,like

3-1 = 2

4-1= 3

5-1 = 4

add all of them = 2+3+4 = 9

then add 1 to it 9+1 =10 so answer is D
by Loyal (9.3k points)
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,830 questions
54,807 answers
189,530 comments
80,836 users