##### what is the maximum number of processes we can allow such that deadlock will never arise

A computer has 5 instances of resources types R.if each process require maximum three instance,then what is the maximum number of processes we can allow such that deadlock will never arise?

A)2

B)3

C)4

D)1

given ans is 2

but i got 3 by below method

total instance < No. of processes + resource taken by each process

5< n+3

2<n

so my ans is 3

plzzz give valid ans

Saijyothsna
3 Feb 2016 09:04 pm

Ans : 2

If you take 3 processes in some cases deadlock may come

suppose P1=2( 2 resources are allocated to P1)

P2=2( 2 resources are allocated to P2)

P3=1( 1 resource allocated to P3)

from the above example no resource is free and all processes are waiting for resources---so deadlock

meet @meet
3 Feb 2016 09:24 pm

yaaa right but according to formula why it is wrong???

rachapalli vinay kumar
3 Feb 2016 09:53 pm

your formula is right @meet ,there n(no.of processes) is min no.of processes required to dead lock occur.

you got n=3 ,it means min 3  processes are  required to dead lock to happen,but question is max no.o processes are required such that dead lock will never arise.

Therefore min 3 processes are required to dead lock occur.max of 2 processes are required for which there  is no dead lock

meet @meet
3 Feb 2016 10:11 pm

but i always use this formula for deadlock free system

and i get correct ans till...

meet @meet
3 Feb 2016 10:17 pm

suppose u use this formula reverse manner ..

exa: for finding how many maximum resource are aquired by each process and suppose they give to no. of processes are 3 (according to my ans) then

5< 3 + X(maximum resource are aquired by each process)

2<X

therefore X=3 which is satisfied ...

howw?????????

Tinu Dahiya
4 Feb 2016 01:59 am

@meet pls have a look.

.

a/c to your formula, total instance < No. of processes + resource taken by each process

answer of this ques will be , m < n + Si

Vivek Vikram Singh
4 Feb 2016 12:32 pm