1,656 views
1 1 vote

Consider a system having ‘m’ resources of the same type. The resources are shared by 3 processes A, B and C which have peak time demands of 5, 7 and 4 respectively. The minimum value of ‘m’ that will ensure that deadlock will never occur is _____.

2 Answers

6 6 votes

Answer : 14

If a process is demanding ‘x’ resource let’s first give (x-1) instances of resource to it.

Process 1: 4

Process 2: 6

Process 3: 3

Now taking one more instance of resource will ensure that one of the process will complete its execution and free all the resources it had, which is then acquired by other process to complete its execution.

Therefore 4+6+3+1= 14 instances of the resources will ensure that deadlock will never occur.

3 3 votes
Let there n process P1, P2, P3, P4, …., Pn and maximum need of each process be X1, X2, X3, X4, …., Xn.

Deadlock will not occur if following condition is satisfied :

(X1 – 1) + (X2 – 1) + (X3 – 1) + (X4 – 1) + ….. + (Xn – 1)  + 1  <= R

Given that there ‘m’ resources of the same type and n = 3 processes.

Maximum need of process A = 5

Maximum need of process B = 7

Maximum need of process C = 4

So, (5 – 1) + (7 – 1) + (4 – 1) + 1 <= m

i.e. 4 + 6 + 3 + 1 <= m

i.e. m >= 14

Thus, minimum value of ‘m’ that will ensure that deadlock will never occur = 14
Position:
Show:

Related questions

0 0 votes
0 0 answers
989
989 views
Sunnidhya Roy asked Dec 27, 2022
989 views
Q: Consider a system having 22 resources of same type. These resources are shared by 4 processes P,Q,R and S having peak demands of 3, 6, a and b. How many ordered pairs ...
1 1 vote
2 answers 2 answers
1.9k
1.9k views
Pankaj Joshi asked Nov 29, 2016
1,875 views
Consider the following system snapshotWhich of the following is a safe sequence?P1, P3, P0, P4, P2P3, P1, P4, P0, P2P3, P4, P1, P0, P2All of theseMy question is how can t...
0 0 votes
2 2 answers
2.4k
2.4k views
Shreya2002 asked Aug 5, 2022
2,371 views
While of the following is incorrect?(a) if a system uses preemptive CPU scheduler then deadlock is not possible in system(b) Deadlock state is an unsafe state.(c) If a sy...
0 0 votes
0 0 answers
446
446 views
Misbah Ghaya asked Aug 20, 2022
446 views
Please list out the best free available video playlist for Deadlock from Operating Systems as an answer here (only one playlist per answer). We'll then select the best pl...