210 views
0 votes
0 votes
there are total 100 resources and each process require 3 instance of resources then find maximum and minimum number of process so that deadlock will not occur.

i am confused for the answer i.e(it is 49 or 98??)

1 Answer

0 votes
0 votes

Let the no.of processes = N

Let each process requires r resources and Total Resources = R

for avoiding deadlock:-

N*(r-1) + 1 ≤ R

N  * 2 + 1 ≤ 100 ===> 2 N ≤ 99 ===> N ≤ 49.5

Now the doubt arises... we have take 49 or 50?

take 50 processes ===> allocate 2 resources for P1,...P49, ===> 49*2=98 resources consumed

now allocate remaining resources P50 ===> Lead to DEADLOCK

take 49 processes ===> allocate 2 resources for P1,...P49, ===> 49*2=98 resources consumed

now allocate remaining resources to any process it will never Lead to DEADLOCK

Therefore Maximum no.of processes, never lead to deadlock = 49

 

Related questions

0 votes
0 votes
1 answer
1