Min r val is 8?

Dark Mode

LRU
asked
in Operating System
Oct 10, 2021

295 views
5 votes

A given system has 13 processes and x number of copies of a resource r. Out of 13 processes, 6 processes require 2 resources each, 3 processes require 3 resources each and the remaining processes require 5 resources each. The minimum value of x will guarantee that the system is deadlock free is ____.

3 votes

Best answer

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) = $13$

Total resource = $r$

Formula

$\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

$(6*2 + 3*3 + 4*5) < 13 + r$

$(12 + 9 + 20) < 13 + r$

$41 < 13 + r$

$28 < r$

$r_{min} = 29$ for deadlock free

1 vote

So we need to recall 2 basic formulaes for deadlock and no deadlock

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

- If deadlock present R<=$\sum_{i=0}^{n}Si-n$
- If no deadlock R>$\sum_{i=0}^{n}Si-n$

now question demands for no deadlock so R>(12+9+20)-13

R>28 so min value for no deadlock is 29