Skip to content
Official PYQ · 2014

GATE CS 2014 Set 3 Q31 — Deadlock

Explain with AI
A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is _________.
View worked solution

Answer: 7

To find the minimum number of tape units required to guarantee that a deadlock never occurs, we analyze the worst-case allocation scenario where a deadlock can exist.

Let:

  • N=3N = 3 (number of programs/processes)
  • R=3R = 3 (maximum tape units required by each program)

Worst-case Deadlock Scenario:

A deadlock occurs when each of the NN programs is allocated exactly one unit less than its maximum requirement, and no more free resources are available to satisfy any program's request.

In this state, each program holds:

R−1=3−1=2 tape unitsR - 1 = 3 - 1 = 2 \text{ tape units}

The total number of tape units allocated in this deadlocked state is:

N×(R−1)=3×2=6 tape unitsN \times (R - 1) = 3 \times 2 = 6 \text{ tape units}

Preventing Deadlock:

If we have even one additional tape unit, at least one program will be able to acquire its required 33 units, complete its execution, and release all its allocated resources back to the system.

Therefore, the minimum number of tape units MM required to ensure deadlock-free operation is:

M=N×(R−1)+1M = N \times (R - 1) + 1

M=3×(3−1)+1=6+1=7M = 3 \times (3 - 1) + 1 = 6 + 1 = 7

Thus, the system must have at least 7 tape units to guarantee that deadlocks never arise.

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

Published
Report a correction
Keep exploringMore Deadlock questions