# GATE1993-7.9, UGCNET-Dec2012-III: 41

17 votes
13.6k 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$

recategorized
0
plz ans
–1
i think 15 but not sure
0

(2+3+5)+1 (for deadlock free )=11

correct answer should be 11 (minimum )

## 5 Answers

34 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.

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.
6
No. Because we dont have a control to distribute the resources (not doing banker's algorithm).
7
sir ignoring the option correct answer should be $11$ (minimum )?
2
yes.
0
So by your explanation answer will be 11 --minimum value of m that ensures that deadlock will never occur.
13 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
10 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.

0
Well, Why not $15$?
0
Not in options
7 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.

0
sir, this formula is giving the right answer. but, may i know the source of this formula for further study?
1 vote

Condition for deadlock free

# R >= Sum(p×(n-1))+1

Here R= total no. Of resources

n= Max demand of resources for each process p

m >= ([1×(3-1)]+[1×(4-1)]+[1×(6-1)]) +1

m>=(2+3+5)+1

m>=11 : for deadlock free

So, answer should be 13,15

Answer:

## Related questions

20 votes
3 answers
1
3.8k views
Assume that the following jobs are to be executed on a single processor system ... Calculate the departure time (completion time) for job $p$ if scheduling is round robin with time slice $1$ $4$ $10$ $11$ $12$ None of the above
25 votes
2 answers
2
5.6k views
The root directory of a disk should be placed at a fixed address in main memory at a fixed location on the disk anywhere on the disk at a fixed location on the system disk anywhere on the system disk
22 votes
4 answers
3
8.3k views
A certain moving arm disk storage, with one head, has the following specifications: Number of tracks/recording surface $= 200$ Disk rotation speed $= 2400$ rpm Track storage capacity $= 62,500$ bits The average latency of this device is $P$ ms and the data transfer rate is $Q$ bits/sec. Write the values of $P$ and $Q$.
53 votes
5 answers
4
9.1k views
Consider $n$ processes sharing the CPU in a round-robin fashion. Assuming that each process switch takes $s$ seconds, what must be the quantum size $q$ such that the overhead resulting from process switching is minimized but at the same time each process is guaranteed to get its turn at the CPU at least every $t$ ... $q \geq \frac{t-ns}{n-1}$ $q \leq \frac{t-ns}{n+1}$ $q \geq \frac{t-ns}{n+1}$