GateAI
CPU and I/O Scheduling

GATE CSE 2014 Set 1 · Q32

NAT2 marksMedium

Time

Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds. Using the *shortest remaining time first* scheduling algorithm, the average process turnaround time (in msec) is _________.

GATE CSE 2014 Set 1 Q32 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 7.2

CPU and I/O Scheduling

We schedule the processes using the preemptive Shortest Remaining Time First (SRTF) policy:

  • At t=0t = 0: Process A arrives (Burst = 66). CPU is allocated to A.

  • At t=3t = 3: Process B arrives (Burst = 22). A's remaining time is 6−3=36 - 3 = 3. Since B has a smaller remaining time (2<32 < 3), B preempts A.

  • At t=5t = 5: Process B completes. Process C arrives (Burst = 44). Ready queue contains:

    • A with remaining time 33

    • C with remaining time 44

    CPU is given to A (remaining time 33).

  • At t=7t = 7: Process D arrives (Burst = 66). A has remaining time 11. A continues running.

  • At t=8t = 8: Process A completes. Ready queue contains:

    • C with remaining time 44

    • D with remaining time 66

    CPU is allocated to C.

  • At t=10t = 10: Process E arrives (Burst = 33). C has remaining time 22. Since 2<32 < 3, C continues.

  • At t=12t = 12: Process C completes. Ready queue contains:

    • E with remaining time 33

    • D with remaining time 66

    CPU is allocated to E.

  • At t=15t = 15: Process E completes. CPU is allocated to D.

  • At t=21t = 21: Process D completes.

### Completion and Turnaround Times:

Turnaround Time (TAT)=Completion Time (CT)−Arrival Time (AT)\text{Turnaround Time (TAT)} = \text{Completion Time (CT)} - \text{Arrival Time (AT)}
  • A:CT=8  ⟹  TAT=8−0=8\text{CT} = 8 \implies \text{TAT} = 8 - 0 = 8

  • B:CT=5  ⟹  TAT=5−3=2\text{CT} = 5 \implies \text{TAT} = 5 - 3 = 2

  • C:CT=12  ⟹  TAT=12−5=7\text{CT} = 12 \implies \text{TAT} = 12 - 5 = 7

  • D:CT=21  ⟹  TAT=21−7=14\text{CT} = 21 \implies \text{TAT} = 21 - 7 = 14

  • E:CT=15  ⟹  TAT=15−10=5\text{CT} = 15 \implies \text{TAT} = 15 - 10 = 5

### Average Turnaround Time:

Average TAT=8+2+7+14+55=365=7.2 msec\text{Average TAT} = \frac{8 + 2 + 7 + 14 + 5}{5} = \frac{36}{5} = 7.2\text{ msec}

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 CPU and I/O Scheduling previous year question is Q32 of the GATE CSE 2014 Set 1 paper. Find more GATE CSE PYQs on CPU and I/O Scheduling 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 CPU and I/O Scheduling 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.

CPU and I/O Scheduling in GATE CSE

CPU and I/O Scheduling has 25 GATE CSE PYQs across 22 papers from 2011 to 2026. 10 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2014 Set 1.

How GATE tests CPU and I/O Scheduling

More from GATE CSE 2014 Set 1

Share this solution

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

GateAI solution cardGATE CSE 2014 Set 1 · Q32 · NAT

Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds. Using the *shortest remaining time first* scheduling algorithm, the average process turnaround time (in msec) 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.