680 views
2 votes
2 votes
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 deadlock is ___

 

2 Answers

Best answer
2 votes
2 votes

ref: https://gateoverflow.in/1394/gate-cse-2005-question-71

      https://gateoverflow.in/2065/gate-cse-2014-set-3-question-31


 

Given,

Total process(n) = $5$

Total resource = $r$


Formula for deadlock free condition

$\sum_{i=1}^{n}S_i < n + r$ 

Where, 

$S_i$ is resource require by process $P_i$

$n$ is Total number of process

$r$ is Total number of resource


According to question

$(7*5) < 5 + r$

$(35) <5 + r$

$30 < r$ 

$r_{max} = 30$ for deadlock

$r_{min} = 31$ for deadlock free

selected by
1 votes
1 votes

R is resources ,n is number of processes and Si is resource copy alloted for each process.

  1. If deadlock present R<=$\sum_{i=1}^{n}Si-n$
  2. No Deadlock R>$\sum_{i=1}^{n}Si-n$ 

5 processes and R copies of total resources in a system, each process requires 7

now R<=(5*7)-5

R<=30 so for R=30 deadlock is possible

Related questions

1 votes
1 votes
1 answer
4
LRU asked Nov 5, 2021
423 views
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 ...