GATE / CS ARCHIVE

GATE CSE 2003 / QUESTION 77

Scheduling alternating CPU and I/O bursts

Operating Systems · CPU Scheduling · Full GATE CSE 2003 paper

GATE 2003, Q77 2 marks · MCQ
Report issue

CPU Scheduling

Question 77, GATE 2003: A uniprocessor runs only two processes, created nearly simultaneously. Each alternates a 10 ms CPU burst with a 90 ms I/O burst; their I/O can proceed in parallel. Which policy gives the least long-run CPU utilization?
A. First come, first served
B. Shortest remaining time first
C. Static priority with different priorities
D. Round robin with a 5 ms quantum
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Ignore switching overhead as the statement supplies none. Under FCFS one process runs 0–10 and the other 10–20. Their I/O ends at 100 and 110, and each finishes its next CPU burst just as the other becomes ready. Thus the CPU supplies 20 ms work per 100 ms: 20% utilization. SRTF and distinct priorities have the same sustained burst staggering here.
2. Under 5 ms round robin, the initial slices are P:0–5, Q:5–10, P:10–15, Q:15–20. Their I/O begins at 15 and 20, only 5 ms apart, and ends at 105 and 110.
3. With the usual ordering when I/O completion coincides with quantum expiry, Q gets the CPU at 110, so the next completed CPU bursts are at 120 and 125. This repeats the paired pattern after 105 ms.
4. Utilization is 20/105≈19.05%, less than 20%, making D the conventional answer. The smaller separation causes more simultaneous I/O and hence more CPU idle time.

Solution: Ignoring context-switch cost, FCFS, shortest-remaining-time, and distinct static priorities run the two initial CPU bursts consecutively for 10 ms each. Their I/O completions stay offset by 10 ms, giving 20 ms of CPU work in a 100 ms steady-state period. With round robin at a 5 ms quantum, the initial bursts finish at 15 and 20 ms, so the processes enter I/O only 5 ms apart. Under the usual ready-queue ordering at simultaneous quantum expiry and I/O completion, this pattern repeats every 105 ms, giving utilization 20/105≈19.05%, below 20%. Thus D is the conventional answer: fine time slicing makes their long I/O intervals overlap more.

Original paper, page 11