GATE / CS ARCHIVE

GATE CSE 2014 SET 1 / QUESTION 32

GATE CSE 2014 Set 1 Q32

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

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

CPU Scheduling

Question 32, GATE 2014: Five processes have (arrival time, execution time), in ms: A=(0,6), B=(3,2), C=(5,4), D=(7,6), E=(10,3). Under preemptive shortest-remaining-time-first on one CPU, find the average turnaround time in ms.
Tap to enlarge
Answer & solution

Official answer: 7.2

Step through it (9 steps)

1. Method and setup. Reevaluate the currently running process whenever a new process arrives. Compare remaining execution time, not the original burst length. Record completion time for each process, then subtract its own arrival time; averaging completion times directly would ignore that the processes enter at different times.

2. Work through the result and its assumptions. SRTF executes A0–3, B3–5, A5–8, C8–12, E12–15, D15–21. At10, C has 2 remaining versus E’s3, so it continues. Completion-minus-arrival times are 8, 2, 7, 14, 5. Their mean 36/5=7.2ms.

Original paper, page 15 · Answer key