Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q23 — Deadlock

Explain with AI

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

Choose one option
View worked solution

Answer: D

To find the condition under which a deadlock can occur, we use the standard resource allocation inequality. For NN processes, each having a maximum demand of MM identical resources, with a total of RR resources available, the system is guaranteed to be deadlock-free if:

∑i=1N(Maxi−1)<R\sum_{i=1}^{N} (Max_i - 1) < R

Since all processes have the same maximum demand MM, this simplifies to:

N(M−1)<RN(M - 1) < R

A deadlock could occur if this condition is violated, i.e., when:

N(M−1)≥RN(M - 1) \ge R

Let's analyze based on the maximum demand MM:

  • With M=3M = 3 (Original GATE 2015 Exam Question):
    Here, R=6R = 6 and M=3M = 3. N(3−1)≥6  ⟹  2N≥6  ⟹  N≥3N(3 - 1) \ge 6 \implies 2N \ge 6 \implies N \ge 3 Thus, a deadlock can occur for any N≥3N \ge 3. Among the given options, N=4N = 4 can lead to a deadlock (for example, two processes holding 22 resources each, and two processes holding 11 resource each, leaving 00 free resources).
  • With M=2M = 2 (As printed in the question text):
    Here, R=6R = 6 and M=2M = 2. N(2−1)≥6  ⟹  N≥6N(2 - 1) \ge 6 \implies N \ge 6 In this case, a deadlock is only possible if N≥6N \ge 6. None of the options 1,2,3,1, 2, 3, or 44 would lead to a deadlock.

Aligning with the official GATE answer key, the intended question uses M=3M = 3, making D the correct option.

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

Published
Report a correction
Keep exploringMore Deadlock questions