2,305 views
9 votes
9 votes

Consider a system having ‘N ’ resources of the same type. ‘N’ resources are shared between 3 processes P1 , P2 and P3 which have individual peak demand of 4, 6 and 8. The minimum value of ‘N’ to ensure that deadlock will never occur, if it is given the maximum requirement for combination of P1 and P3 is 9 are__________.

3 Answers

Best answer
8 votes
8 votes
P1 P2 P3
4 6 8

Asked :
The minimum value of ‘N’ to ensure that deadlock will never occur.

Important Fact:

maximum requirement for combination of P1 and P3 is 9

Solution:
Ilustration about important fact is at any point of time both process does not require more than 9 resources
Analogy : For example you have two application(web) which are running simulatenously but ensuring that the bandwidth required by both of them will not exceed by some Value.


 Possible combination :
$P1:P3= $ $(4,5) (3,6) (2,7) (1,8)$


Thus to satisfy combination We need atmost 7 and one system backup resource.
Total Resource need =7+5+1(this one to ensure retrival once process completes execution)

Total=13

selected by
5 votes
5 votes

Let's focus this statement:- 

if it is given the maximum requirement for combination of P1 and P3 is 9

it means that at any time sum of maximum resources taken by P1& P3 is 9

now lets see all possiblties:-

P1:P3 :P2 =  (4,5)(3,6)(2,7)(1,8)

now for following cases consider the condition for no deadlock:- "allocate n-1 resource to evry process after then allocating one more resource guarantee of no_deadlock."

(4,5,6) =(4-1,5-1,6-1)+1=13

(3,6,6)=(2,5,5)+1=13

(2,7,6)=(1,6,5)+1=13

(1,8,6)=(0,7,5)+1=13