GateAI
Deadlock

GATE CSE 2026 Set 1 · Q35

NAT1 markEasy

Time

Consider a system consisting of kk instances of a resource RR, being shared by 5 processes. Assume that each process requires a maximum of two instances of resource RR and a process can request or release only one instance at a time. Further, a process can request the second instance of the resource only after acquiring the first instance. The minimum value of kk for the system to be deadlock-free is ________. (answer in integer)

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 6

Deadlock

To guarantee that the system is deadlock-free, the total number of resource instances kk must be strictly greater than the maximum number of resources that can be allocated without any single process completing its maximum demand.

Given:

  • Number of processes N=5N = 5

  • Maximum demand of each process Mi=2M_i = 2 for all i∈{1,2,…,5}i \in \{1, 2, \dots, 5\}

In the worst-case allocation scenario, each process is allocated one less than its maximum demand:

Allocated instances per process=Mi−1=2−1=1\text{Allocated instances per process} = M_i - 1 = 2 - 1 = 1

The total number of instances allocated in this worst-case state is:

∑i=1N(Mi−1)=5×1=5\sum_{i=1}^{N} (M_i - 1) = 5 \times 1 = 5

To ensure at least one process gets its remaining requested instance, completes execution, and releases all its resources, we need at least 1 additional resource instance:

k≥∑i=1N(Mi−1)+1=5+1=6k \ge \sum_{i=1}^{N} (M_i - 1) + 1 = 5 + 1 = 6

Thus, the minimum value of kk for the system to be deadlock-free is 6.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Deadlock previous year question is Q35 of the GATE CSE 2026 Set 1 paper. Find more GATE CSE PYQs on Deadlock in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Deadlock PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Deadlock in GATE CSE

Deadlock has 11 GATE CSE PYQs across 10 papers from 2014 to 2026. 2 of them are 1-mark NAT questions like this one, and GATE CSE 2026 Set 1 has 2.

How GATE tests Deadlock

More from GATE CSE 2026 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2026 Set 1 · Q35 · NAT

Consider a system consisting of k instances of a resource R, being shared by 5 processes. Assume that each process requires a maximum of two instances of resource R and a process can request or release only one instance at a time. Further, a process can request the second instance of the resource only after acquiring the first instance. The minimum value of k for the system to be deadlock-free is … (answer in integer)

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.