The minimum value of 𝑘 for the system to be deadlock-free is ________. (answer in integer)
Correct : 6
The correct answer is 6.
This is a classic deadlock avoidance problem. The standard formula to find the minimum number of resource instances required to guarantee a deadlock-free environment is:
Minimum k = n × (m − 1) + 1
Where:
n = number of processes = 5
m = maximum instances any process can hold = 2
So: k = 5 × (2 − 1) + 1 = 5 × 1 + 1 = 6
Why does this work? The worst-case deadlock scenario is when every process holds (m−1) instances and is waiting for one more. With 5 processes each holding 1 instance, that''s 5 instances total consumed and every process stuck waiting. If k = 5, all instances are held with no process able to proceed - deadlock.
But with k = 6, even if all 5 processes each hold 1 instance (5 used), there is still 1 remaining instance. That extra instance can be given to one process, allowing it to acquire its second instance, complete, and release both. This chain reaction ensures all processes eventually finish - no deadlock possible.
Similar Questions
Total Unique Visitors