822 views
0 votes
0 votes

Suppose 10 processes P1 to P10 share 7 identical resource units which can be reserved and release 1 at are time the maximum resource requirement of a processs P i is SP where SP is greater then 0. The maximum value of that ensures deadlock does not occurs is ________ .     

2 Answers

5 votes
5 votes

To prevent deadlock...we give 1 less than the maximum requirement to each process. Then add one more resource so that at least one process can complete and we don't have a deadlock situation. 

This question is very poorly defined. It is based on a previous year Gate question.

So we give Sp-1 to each of the 10 processes and add one more. We get 10Sp-10+1. This must be equal to 7( no of resources we have) if we want to avoid deadlock. 

So 10Sp= 16

2 votes
2 votes

Each process needs 7 resource units.total of 70 resources.

p1 p2 p3 p4 p5 p6 p7 p8 p9 p10
7 7 7 7 7 7 7 7 7 7

Each process needs maximum seven units of resources.to prevent deadlock these are maximum resources.

minimum no of resources are=(6*10)+1.  //for all 10 process allocate 6 units of resources all are waiting on each other for one more resource to excution.

so total of 61 resources are needed to prevent deadlock.

Related questions

0 votes
0 votes
2 answers
1
DAWID15 asked Dec 19, 2022
760 views
I’m getting 2 as the answer, but the correct one given by them is 5.Somebody please confirm.