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.
-
Let be the number of processes (programs).
-
Each process has a maximum resource requirement tape units.
-
Worst-Case Allocation (Deadlock State):
- In the worst possible state without deadlock resolution, every process holds one unit less than its maximum requirement ( units):
- Total units allocated across all processes in this state:
- If only 6 tape units are available, all 3 processes are waiting for one additional unit, resulting in a deadlock.
- In the worst possible state without deadlock resolution, every process holds one unit less than its maximum requirement ( units):
-
Deadlock-Free Threshold:
- If the system has at least 1 additional unit:
- At least one process is guaranteed to receive its third unit, finish execution, and release all 3 units to satisfy other processes.
- If the system has at least 1 additional unit:
Hence, the minimum number of tape units required is 7.
7
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.