GateAI
CPU and I/O Scheduling

GATE CSE 2016 Set 2 · Q47

NAT2 marksMedium

Time

Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first. The average turn around time of these processes is ________ milliseconds.

GATE CSE 2016 Set 2 Q47 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 8.25 (±0.05) (±0.05)

CPU and I/O Scheduling

We apply the Preemptive Shortest Remaining Time First (SRTF) scheduling algorithm:

### Gantt Chart Execution:

  • At t=0t = 0: P1P_1 arrives with remaining time 1010. P1P_1 starts executing.

  • At t=3t = 3: P2P_2 arrives with burst time 66. Remaining time of P1=10−3=7P_1 = 10 - 3 = 7. Since remaining time of P2P_2 (66) < P1P_1 (77), P1P_1 is preempted and P2P_2 executes.

  • At t=7t = 7: P3P_3 arrives with burst time 11. Remaining time of P2=6−(7−3)=2P_2 = 6 - (7-3) = 2. Since P3P_3 (11) < P2P_2 (22), P2P_2 is preempted and P3P_3 executes.

  • At t=8t = 8: P3P_3 finishes execution. P4P_4 arrives with burst time 33.

    • Available processes: P2P_2 (remaining 22), P4P_4 (remaining 33), P1P_1 (remaining 77).

    • Shortest remaining is P2P_2 (22). P2P_2 executes from t=8t = 8 to t=10t = 10 and finishes.

  • At t=10t = 10: Available processes: P4P_4 (33), P1P_1 (77).

    • P4P_4 executes from t=10t = 10 to t=13t = 13 and finishes.

  • At t=13t = 13: Available process: P1P_1 (77).

    • P1P_1 executes from t=13t = 13 to t=20t = 20 and finishes.

### Completion and Turnaround Times:

  • P1P_1: Completion Time (CT) = 2020, Turnaround Time (TAT = CT - AT) = 20−0=2020 - 0 = 20

  • P2P_2: Completion Time (CT) = 1010, Turnaround Time (TAT) = 10−3=710 - 3 = 7

  • P3P_3: Completion Time (CT) = 88, Turnaround Time (TAT) = 8−7=18 - 7 = 1

  • P4P_4: Completion Time (CT) = 1313, Turnaround Time (TAT) = 13−8=513 - 8 = 5

### Average Turnaround Time:

Average TAT=20+7+1+54=334=8.25 milliseconds\text{Average TAT} = \frac{20 + 7 + 1 + 5}{4} = \frac{33}{4} = 8.25\text{ milliseconds}

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 Q47 of the GATE CSE 2016 Set 2 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 2016 Set 2.

How GATE tests CPU and I/O Scheduling

More from GATE CSE 2016 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2016 Set 2 · Q47 · NAT

Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first. The average turn around time of these processes is … milliseconds.

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.