The GATE Grind

GATE 2018 CS – Question 34

Operating System · Deadlock · 1 mark · Numerical answer

Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of $K$ instances. Resource instances can be requested and released only one at a time. The largest value of $K$ that will always avoid deadlock is ________.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 2

Explanation

Deadlock is impossible if $n(K-1)+1\le R$, i.e. $3(K-1)+1\le4$, so $K\le2$.