1,182 views
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.

Is it 5?
Maximum need of each process is 5.
$\text{(max_need - 1)*(number of processes)} +1 \leq \text{number of available resources}$
$4*(4+n)+1 \leq 28\\16+4n+1 \leq 28\\4n+17 \leq 28 \\ 4n \leq 11$
$n=2$

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

4 process request 5 instances of P", I got confused whether each request 5 instances or

together?

@Learner_jai

exactly even i was confused with the language of the question, i dont think question is well framed!