437 views
1 votes
1 votes
Given a system with 3 processes where each process requires at least 2 resources to complete their execution, then the largest number of resources which will guarantee a deadlock is ___

1 Answer

Best answer
3 votes
3 votes
Here they are asking for a guaranteed deadlock, and we can only guarantee a deadlock when we have fewer resources than the max requirement by any candidate.

Lets label these 3 processes, $p_1,p_2,p_3$,

$R_{max-guaranteed-deadlock} = max(R_1, R_2,R_3) -1$; where $R_i$ is the requirement of $i^{th}$ process.

$\implies R_{max-guaranteed-deadlock} =2 -1 = \mathbf{1} $.

Note that the maximum value for which we may have a deadlock is different from the max value to guarantee a deadlock.

Max possible value for which we may have deadlock = $\displaystyle  \sum_{i=1}^{3}(R_i -1) = 3$

The minimum value to guarantee no deadlock= Max possible value for which we may have deadlock + 1 = 3+1 = 4.

Word guarantee changes everything.
selected by
Answer:

Related questions

2 votes
2 votes
2 answers
4
LRU asked Oct 10, 2021
741 views
Given 5 processes and R copies of total resources in a system, each process requires 7 copies of resources to complete its execution. The maximum value of R to have deadl...