GateAI
CPU and I/O Scheduling

GATE CSE 2014 Set 2 · Q32

NAT2 marksMedium

Time

Three processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single computation that requires tct_c CPU milliseconds and then initiates a single I/O operation that lasts for tiot_{io} milliseconds. It is assumed that the computer where the processes execute has sufficient number of I/O devices and the OS of the computer assigns different I/O devices to each process. Also, the scheduling overhead of the OS is negligible. The processes have the following characteristics: The processes A, B, and C are started at times 0, 5 and 10 milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of 50 milliseconds. The time in milliseconds at which process C would complete its first I/O operation is _________.

GATE CSE 2014 Set 2 Q32 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 1000

CPU and I/O Scheduling

Let us trace the Round Robin execution with a time quantum of 50 ms50\text{ ms}:

  • t=0 mst = 0\text{ ms}: Process A arrives with CPU burst 100 ms100\text{ ms}. Ready Queue: [A][\text{A}]. Process A executes for its time slice from t=0t = 0 to 5050.

  • During this time, Process B arrives at t=5 mst = 5\text{ ms} and Process C arrives at t=10 mst = 10\text{ ms}.

  • t=50 mst = 50\text{ ms}: Process A's time slice expires (A has 50 ms50\text{ ms} CPU remaining). A is preempted and added to the tail of the queue. Ready Queue: [B,C,A][\text{B}, \text{C}, \text{A}].

  • t=50 to 100 mst = 50\text{ to } 100\text{ ms}: Process B executes for 50 ms50\text{ ms} (B has 300 ms300\text{ ms} remaining). Ready Queue: [C,A,B][\text{C}, \text{A}, \text{B}].

  • t=100 to 150 mst = 100\text{ to } 150\text{ ms}: Process C executes for 50 ms50\text{ ms} (C has 150 ms150\text{ ms} remaining). Ready Queue: [A,B,C][\text{A}, \text{B}, \text{C}].

  • t=150 to 200 mst = 150\text{ to } 200\text{ ms}: Process A executes its remaining 50 ms50\text{ ms} CPU burst and completes its CPU phase for iteration 1. A immediately moves to I/O for 500 ms500\text{ ms} (from t=200t = 200 to 700 ms700\text{ ms}). Ready Queue: [B,C][\text{B}, \text{C}].

  • t=200 to 250 mst = 200\text{ to } 250\text{ ms}: Process B executes for 50 ms50\text{ ms} (B has 250 ms250\text{ ms} remaining). Ready Queue: [C,B][\text{C}, \text{B}].

  • t=250 to 300 mst = 250\text{ to } 300\text{ ms}: Process C executes for 50 ms50\text{ ms} (C has 100 ms100\text{ ms} remaining). Ready Queue: [B,C][\text{B}, \text{C}].

  • t=300 to 350 mst = 300\text{ to } 350\text{ ms}: Process B executes for 50 ms50\text{ ms} (B has 200 ms200\text{ ms} remaining). Ready Queue: [C,B][\text{C}, \text{B}].

  • t=350 to 400 mst = 350\text{ to } 400\text{ ms}: Process C executes for 50 ms50\text{ ms} (C has 50 ms50\text{ ms} remaining). Ready Queue: [B,C][\text{B}, \text{C}].

  • t=400 to 450 mst = 400\text{ to } 450\text{ ms}: Process B executes for 50 ms50\text{ ms} (B has 150 ms150\text{ ms} remaining). Ready Queue: [C,B][\text{C}, \text{B}].

  • t=450 to 500 mst = 450\text{ to } 500\text{ ms}: Process C executes its remaining 50 ms50\text{ ms} CPU burst and completes its CPU execution at t=500 mst = 500\text{ ms}.

At t=500 mst = 500\text{ ms}, Process C initiates its first I/O operation of duration tio=500 mst_{io} = 500\text{ ms}.

Therefore, Process C completes its first I/O operation at:

500+500=1000 ms500 + 500 = 1000\text{ ms}

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 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 2014 Set 2.

How GATE tests CPU and I/O Scheduling

More from GATE CSE 2014 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2014 Set 2 · Q32 · NAT

Three processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single computation that requires tc CPU milliseconds and then initiates a single I/O operation that lasts for tio milliseconds. It is assumed that the computer where the processes execute has sufficient number of I/O devices and the OS of the computer assigns different I/O devices to each process. Also, the scheduling overhead of the OS is negligible. The processes have the following characteristics: The processes A, B, and C are started at times 0, 5 and 10 milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of 50 milliseconds. The time in milliseconds at which process C would complete its first I/O operation 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.