Skip to main content

GATE CSE 1998Operating System › Deadlocks & Resource AllocationVerified

GATE CSE 1998 PYQ: A computer has six tape drives, with n n n processes competing for them. Each process may need two drives.…

A computer has six tape drives, with nn processes competing for them. Each process may need two drives. What is the maximum value of nn for the system to be deadlock free?

  1. A
    6
  2. B
    5
    Correct answer
  3. C
    4
  4. D
    3

Answer

(B) 5 5 5

Approach

Use the standard deadlock-free resource bound: if each process can need at most 2 tape drives, the worst deadlock-prone situation occurs when each process already holds 1 drive and is waiting for a second one. To guarantee no deadlock, there must be enough drives so that at least one process can still obtain its second drive and finish. Thus the condition is $n(2-1)+1 \le 6$, i.e. $n+1 \le 6$.

The maximum number of processes that can coexist deadlock-freely with 6 tape drives, where each process needs at most 2 drives, is $n=5$. The correct option is B.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.