edited by
2,810 views
0 votes
0 votes
Consider a system which has $28$ instances of a resource $P$ such that $4+n$ processes share them,$4$ process request $5$ instances of $'P'.$ If $n$ process request $5$ instances of same resources what is the maximum value of $n$ such that system is in safe state______
edited by

1 Answer

Best answer
3 votes
3 votes
Given : Total Resources: 28

Total no of processes : 4+n

Out of this 4 process require 5 resources and n require 5. So For the minimum no of processes for which deadlock occurs we will take away 1  resource from each of the process. So total 4 processes have 4 resources each and n have 4.

So that means 4*4+4*n=28 for deadlock so for deadlock minimum val of n is n=(28-16)/4=3

This causes deadlock. So for system to be deadlock free maximum value of n is = 3-1=2. This is because this value of n will not lead to any deadlock 3 would. So we first calculate the  value for minimum value which causes deadlock and then subtract 1 for max value which wont cause deadlock.
selected by

Related questions

1 votes
1 votes
1 answer
2
0 votes
0 votes
1 answer
3
aaru14 asked Dec 10, 2017
453 views
https://gateoverflow.in/?qa=blob&qa_blobid=16406706223773445572someone plz help how to detect deadlock in this type of question??
0 votes
0 votes
1 answer
4