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

Consider a system having m resources of the same type. These resources are shared by $3$ processes $A$,$B$, and $C$ which have peak demands of $3$, $4$ and $6$ respectively.  For what value of m deadlock will not occur?

  1. $7$
  2. $9$
  3. $10$
  4. $13$
  5. $15$
asked in Operating System by Veteran (59.6k points)
recategorized by | 6.3k views
0
plz ans
–1
i think 15 but not sure

4 Answers

+28 votes
Best answer

$\mathbf{13 \text{ and } 15.}$

Consider the worst scenario: all processes require one more instance of the resource. So, $P1$ would have got $2$, $P2 - 3$ and $P3 - 5$. Now, if one more resource is available at least one of the processes could be finished and all resources allotted to it will be free which will lead to other processes also getting freed. So, $2 + 3 + 5 = 10$ would be the maximum value of m so that a deadlock can occur.

answered by Veteran (363k points)
edited by
0
Can't it be 7?? Because if p1 and p2 both have sufficient number of resources, so they can run to end and after finishing they will release the resources occupied by them. Now, P3 can take 6 resources and can run.
+2
No. Because we dont have a control to distribute the resources (not doing banker's algorithm).
+5
sir ignoring the option correct answer should be $11$ (minimum )?
+1
yes.
0
So by your explanation answer will be 11 --minimum value of m that ensures that deadlock will never occur.
+11 votes
Worst case

3-1 =2

4-1=3

6-1=5

10 then may be deadlock but we don't want deadlock so we required minimum 11 resources

So ans is any number $\geq$ 11
answered by (215 points)
+9 votes

We have m resourses now suppose we have three process like below

P1,P2 and P3

P1=2

P2=3

P3=5

Max resourses by which deadlock happen=10

So minimum resourses by which deadlock didn't happen =10+1>=11 therefore answer 13 according to option.

answered by Loyal (9.1k points)
–1
Well, Why not $15$?
0
Not in options
+4 votes
ans is 13 and 15
 
Formula-
Total of max needs < (no. of resource instances + no. of processes)
(3+4+6)< m+3.
 
 
m>10. hence m should be eleven or above.
Only 13 and 15  qualify the criteria.

 

answered by Active (1.7k points)

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

42,609 questions
48,606 answers
155,764 comments
63,773 users