Skip to content
Official PYQ · 1992

GATE CS 1992 Q02-xi — Deadlock

Explain with AI

A computer system has 66 tape devices, with n processes competing for them. Each process may need 33 tape drives. The maximum value of n for which the system is guaranteed to be deadlock-free is:

Choose one option
View worked solution

Answer: A

To guarantee that the system is deadlock-free, we analyze the worst-case resource allocation scenario.

Let:

  • R=6R = 6 (total number of tape devices)
  • nn = number of processes
  • Maxi=3Max_i = 3 (maximum demand of each process ii)

In the worst-case scenario, each of the nn processes is allocated one resource less than its maximum requirement, and no resources are left free. Under this condition, every process is blocked, resulting in a deadlock.

The maximum number of resources allocated in this worst-case state is:

Worst-case Allocation=n×(Maxi−1)=n×(3−1)=2n\text{Worst-case Allocation} = n \times (Max_i - 1) = n \times (3 - 1) = 2n

To guarantee that a deadlock never occurs, the total number of available resources RR must be strictly greater than this worst-case allocation, ensuring at least one process can always get its remaining required resource and run to completion:

R≥n×(Maxi−1)+1R \ge n \times (Max_i - 1) + 1

Substitute the given values into the inequality:

6≥2n+1  ⟹  2n≤5  ⟹  n≤2.56 \ge 2n + 1 \implies 2n \le 5 \implies n \le 2.5

Since the number of processes nn must be an integer, the maximum value of nn for which the system is guaranteed to be deadlock-free is 22.

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

Published
Report a correction
Keep exploringMore Deadlock questions