GATE / CS ARCHIVE

GATE CSE 2006 / QUESTION 64

Longest remaining time first turnaround

Operating Systems · CPU Scheduling · Full GATE CSE 2006 paper

GATE 2006, Q64 2 marks · MCQ
Report issue

CPU Scheduling

Question 64, GATE 2006: Processes with IDs 0,1,2 all arrive at time zero and need 2,4,8 compute units respectively. Use longest-remaining-time-first, reevaluated each time unit, with ties favoring the lower ID. What is average turnaround time?
Options:
(A) 13
(B) 14
(C) 15
(D) 16
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Using one-unit scheduling steps and breaking ties by the lower process ID, the running process IDs for times 0 through 13 are 2,2,2,2,1,2,1,2,0,1,2,0,1,2. Completion times are 12,13,14 for IDs 0,1,2.

2. Since arrivals are all zero, mean turnaround=(12+13+14)/3=13 units, A. This uses the intended discrete time-unit model; ideal continuous reevaluation at every instant would require a separate tie-sharing convention.

3. Teaching check: Turnaround equals completion time because every arrival is zero. LRTF initially favors the eight-unit process, but its remaining time eventually ties the four-unit process and the tie rule changes the schedule. Computing each completion time is safer than averaging burst lengths or waiting times alone.

Original paper, page 9