GateAI
Deadlock

GATE CSE 2017 Set 2 · Q33

MCQ2 marksEasy

Time

A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:

Which of the following best describes current state of the system?

GATE CSE 2017 Set 2 Q33 diagram

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) Safe, Not Deadlocked

Deadlock

To determine the system state, we apply the Banker's Safety Algorithm:

  1. Total Tape Drives = 99

  2. Total Allocated Drives = 3+1+3=73 + 1 + 3 = 7

  3. Available Drives = 9−7=29 - 7 = 2

Now, calculate the remaining need for each process (Need=Max−Allocated\text{Need} = \text{Max} - \text{Allocated}):

  • Need(P1)=7−3=4\text{Need}(P_1) = 7 - 3 = 4

  • Need(P2)=6−1=5\text{Need}(P_2) = 6 - 1 = 5

  • Need(P3)=5−3=2\text{Need}(P_3) = 5 - 3 = 2

Check for a safe execution sequence:

  • Step 1: Available=2\text{Available} = 2. This satisfies Need(P3)=2≤2\text{Need}(P_3) = 2 \le 2. P3P_3 executes and releases its 3 drives. New Available=2+3=5\text{New Available} = 2 + 3 = 5.

  • Step 2: With Available=5\text{Available} = 5, it satisfies Need(P1)=4≤5\text{Need}(P_1) = 4 \le 5. P1P_1 executes and releases its 3 drives. New Available=5+3=8\text{New Available} = 5 + 3 = 8.

  • Step 3: With Available=8\text{Available} = 8, it satisfies Need(P2)=5≤8\text{Need}(P_2) = 5 \le 8. P2P_2 completes.

A safe sequence ⟨P3,P1,P2⟩\langle P_3, P_1, P_2 \rangle exists. Since the system is in a Safe state, it is guaranteed to be Not Deadlocked.

Thus, the correct option is (B).

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 Q33 of the GATE CSE 2017 Set 2 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. 4 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2017 Set 2.

How GATE tests Deadlock

More from GATE CSE 2017 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2017 Set 2 · Q33 · MCQ

A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below: Which of the following best describes current state of the system?

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.