Is it 5?

Dark Mode

1,183 views

0 votes

closed with the note:
got the answer

A system has 28 instances of resource **P **such that 4+n processes share them, 4 process request 5 instances of **P**. If n processes request 5 instances of same resource what is maximum value of n such that the system is in safe state.(ans=2).pls explain.

3 votes

Best answer

in this question 4 process wants 5 instances each,

so for avoiding deadlock, we have provide minimum 4 instances each and 1 shared instance,i.e

p1 p2 p3 p4 and 1 shared

4 4 4 4

so total alloted instance is 4+4+4+4+1=17

then remainning instance are 28-17=11

so, we have to check for n process and instance provide to them 5

if value of n=2

then minimum -> 4+4+1=9

if n=3

then 4+4+4+1=13

13 is minimum required but we have only 11

so ans is n=2

so for avoiding deadlock, we have provide minimum 4 instances each and 1 shared instance,i.e

p1 p2 p3 p4 and 1 shared

4 4 4 4

so total alloted instance is 4+4+4+4+1=17

then remainning instance are 28-17=11

so, we have to check for n process and instance provide to them 5

if value of n=2

then minimum -> 4+4+1=9

if n=3

then 4+4+4+1=13

13 is minimum required but we have only 11

so ans is n=2

@Piyush mishra "4 process request 5 instances of **P", I got confused whether each request 5 instances or **

**together?**

0