Question

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 _____.

Official answer and solution
Official answer
7
From
Official GATE 2014 answer key

Solution

Apply the deadlock prevention condition using the worst-case allocation state.

  1. Let n=3n = 3 be the number of processes (programs).

  2. Each process has a maximum resource requirement m=3m = 3 tape units.

  3. Worst-Case Allocation (Deadlock State):

    • In the worst possible state without deadlock resolution, every process holds one unit less than its maximum requirement (m−1m - 1 units):
      Units per process=3−1=2.\text{Units per process} = 3 - 1 = 2.
    • Total units allocated across all 33 processes in this state:
      n×(m−1)=3×2=6 units.n \times (m - 1) = 3 \times 2 = 6\text{ units}.
    • If only 6 tape units are available, all 3 processes are waiting for one additional unit, resulting in a deadlock.
  4. Deadlock-Free Threshold:

    • If the system has at least 1 additional unit:
      Rmin⁡=n(m−1)+1=3(3−1)+1=6+1=7 units.R_{\min} = n(m - 1) + 1 = 3(3 - 1) + 1 = 6 + 1 = 7\text{ units}.
    • At least one process is guaranteed to receive its third unit, finish execution, and release all 3 units to satisfy other processes.

Hence, the minimum number of tape units required is 7.

Final answer

7

Common trap

Computing 3 * 3 = 9 by requiring all processes to run simultaneously to completion.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 3
Question
41 of 65, printed as CS Q.31
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.