Question

A system has 6 identical resources and NN processes competing for them. Each process can request at most 2 resources. Which one of the following values of NN could lead to a deadlock?

Choose one option
Official answer and solution
Official answer
D
From
Official GATE 2015 answer key

Solution

Analyze the conditions under which resource requests can lead to deadlock versus safe execution.

We are given:

  • Total identical resources m=6m = 6.
  • Each process requires at most w=2w = 2 resources.

Under simultaneous peak demand analysis:

  • If N=1N = 1: peak demand is 1×2=2≤61 \times 2 = 2 \le 6.
  • If N=2N = 2: peak demand is 2×2=4≤62 \times 2 = 4 \le 6.
  • If N=3N = 3: peak demand is 3×2=6≤63 \times 2 = 6 \le 6. Even if all 3 processes demand their maximum simultaneously, the available resources (6) can completely satisfy all of them concurrently without any waiting.
  • If N=4N = 4: total maximum demand is 4×2=8>64 \times 2 = 8 > 6. Simultaneous maximum requests cannot all be satisfied at once, creating resource competition and potential blocking.

The question asks which of the given values could lead to a deadlock; among the options 1,2,3,41, 2, 3, 4, option D (N=4N = 4) is the only value where aggregate demand exceeds the total pool of resources.

Final answer

D

Common trap

Applying the single-resource-at-a-time worst-case formula m≥N(k−1)+1m \ge N(k-1)+1 (which gives 6≥N+1  ⟹  N≤56 \ge N+1 \implies N \le 5) without noticing that the question focuses on whether simultaneous peak requests exceed total system capacity (4×2=8>64 \times 2 = 8 > 6).

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

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 2
Question
33 of 65, printed as CS Q.23
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.