GATE / CS ARCHIVE

GATE CSE 2014 SET 2 / QUESTION 32

GATE CSE 2014 Set 2 Q32

Operating Systems · CPU Scheduling · Full GATE CSE 2014 Set 2 paper

GATE 2014 Set 2, Q32 2 marks · NAT
Report issue

CPU Scheduling

Question 32, GATE 2014: Processes A,B,C each repeat 100 iterations of a CPU burst followed by independent-device I/O. CPU burst times are A 100 ms, B 350 ms, C 200 ms; all I/O operations take 500 ms. They arrive at 0,5,10 ms respectively. With round-robin scheduling, 50 ms quantum, no scheduling overhead, and sufficient independent I/O devices, when does C finish its first I/O, in ms from time 0?
Tap to enlarge
Answer & solution

Official answer: 1000

Step through it (16 steps)

1. Set up the reasoning. Maintain the ready queue at quantum boundaries. Later arrivals join the queue but do not preempt A's already running time slice. Remove a process from the ready queue as soon as its CPU burst finishes and it blocks on I/O.

2. Derive the result. The50ms slices are A0–50, B50–100, C100–150, A150–200, B200–250, C250–300, B300–350, C350–400, B400–450, C450–500. A starts I/O at 200; C completes its 200ms CPU burst at 500 and its independent 500ms I/O at 1000.

3. Check the interpretation. C needs four 50-ms slices, not four consecutive slices. Its I/O can overlap A's and other CPU activity because separate devices are available; add 500 ms to C's CPU completion time rather than to its arrival.

Original paper, page 38 · Answer key