Skip to content
Official PYQ · 1997

GATE CS 1997 Q6.7 — Deadlock

Explain with AI

An operating system contains 33 user processes each requiring 22 units of resource RR. The minimum number of units of RR such that no deadlocks will ever arise is

Choose one option
View worked solution

Answer: C

To find the minimum number of units of resource RR required to guarantee that a deadlock will never occur, we can analyze the worst-case allocation scenario where a deadlock is just about to happen.

Let:

  • Number of processes, N=3N = 3
  • Maximum resource requirement for each process, Maxi=2Max_i = 2

Worst-case allocation without progress:
Each process is allocated one unit less than its maximum requirement. In this state, every process is blocked waiting for its final resource, resulting in a deadlock if no more resources are available.

Resources allocated in worst-case=∑i=1N(Maxi−1)=3×(2−1)=3 units\text{Resources allocated in worst-case} = \sum_{i=1}^{N} (Max_i - 1) = 3 \times (2 - 1) = 3\text{ units}

Deadlock Prevention:
If we add just 11 more resource to this state, at least one process will get its maximum requirement, complete its execution, and release all its allocated resources back to the pool. This prevents any deadlock from occurring.

Minimum resources (R)≥∑i=1N(Maxi−1)+1\text{Minimum resources } (R) \ge \sum_{i=1}^{N} (Max_i - 1) + 1 R≥3+1=4R \ge 3 + 1 = 4

Thus, the minimum number of units of RR to ensure no deadlocks ever arise is 4.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Deadlock questions