GATE / CS ARCHIVE

GATE CSE 2016 SET 1 / QUESTION 20

GATE CSE 2016 Set 1 Q20

Operating Systems · CPU Scheduling · Full GATE CSE 2016 Set 1 paper

GATE 2016 Set 1, Q20 1 mark · MCQ
Report issue

CPU Scheduling

Question 20, GATE 2016: CPU-bound processes with unequal burst lengths all arrive simultaneously. Which scheduling policy minimizes average ready-queue waiting time? A: shortest remaining time first. B: round robin with quantum shorter than every burst. C: uniform random. D: highest priority first, with priority proportional to burst length.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

All processes are available initially and are CPU-bound, so shortest-remaining-time-first reduces to shortest-job-first. If a longer job immediately precedes a shorter one, swapping them reduces the sum of waiting times by the burst-length difference. Repeated exchanges yield increasing burst order, which is optimal. Thus A.

Suppose adjacent bursts have lengths a>b. Executing a before b contributes a to b's wait, whereas reversing them contributes b to a's wait; completion time of the pair and waits of later jobs stay unchanged. The swap decreases total wait by a−b. Eliminating all such inversions gives ascending burst order. Since all arrivals occur at time zero, no newly arriving short job triggers a distinct preemption issue; SRTF executes this same optimal order.

Original paper, page 10 · Answer key