GateAI
Deadlock

GATE CSE 2018 · Q24

NAT1 markEasy

Time

Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of KK instances. Resource instances can be requested and released only one at a time. The largest value of KK that will always avoid deadlock is _______.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 2

Deadlock

For a system with NN processes sharing RR identical resource instances, where each process requires at most KK resources, the condition to guarantee that deadlock will never occur is:

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

Since all NN processes have the same maximum requirement KK:

N(K−1)+1≤R  ⟹  N(K−1)<RN(K - 1) + 1 \le R \implies N(K - 1) < R

Given N=3N = 3 and R=4R = 4:

3(K−1)<43(K - 1) < 4
3(K−1)≤33(K - 1) \le 3
K−1≤1K - 1 \le 1
K≤2K \le 2

Thus, the largest value of KK that will always avoid deadlock is 2.

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 Q24 of the GATE CSE 2018 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 it is the only one in GATE CSE 2018.

How GATE tests Deadlock

More from GATE CSE 2018

Share this solution

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

GateAI solution cardGATE CSE 2018 · Q24 · NAT

Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of K instances. Resource instances can be requested and released only one at a time. The largest value of K that will always avoid deadlock is …

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.