GATE / CS ARCHIVE

GATE CSE 2004 / QUESTION 46

Preemptive shortest remaining time

Operating Systems · CPU Scheduling · Full GATE CSE 2004 paper

GATE 2004, Q46 2 marks · MCQ
Report issue

CPU Scheduling

Question 46, GATE 2004: Processes (arrival time,CPU burst), in ms, are P1=(0,5), P2=(1,3), P3=(2,3), P4=(4,1). What is the average turnaround time under preemptive shortest remaining processing time first (SRPT)?
Options:
(A) 5.50 ms
(B) 5.75 ms
(C) 6.00 ms
(D) 6.25 ms
Question 46, GATE 2004: Processes (arrival time,CPU burst), in ms, are P1=(0,5), P2=(1,3), P3=(2,3), P4=(4,1). What is the average turnaround time under preemptive shortest remaining processing time first (SRPT)?
Options:
(A) 5.50 ms
(B) 5.75 ms
(C) 6.00 ms
(D) 6.25 ms
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (7 steps)

1. A valid SRPT schedule is P1:[0,1), P2:[1,4), P4:[4,5), P3:[5,8), P1:[8,12). P2 still has the smallest remaining time when P3 arrives.

2. Completion times for P1,P2,P3,P4 are 12,4,8,5; subtracting arrivals 0,1,2,4 gives turnaround times 12,3,6,1. Their mean is 22/4=5.50ms.

3. Teaching check: Turnaround is completion minus arrival, not total waiting time. The four turnaround values are 12,3,6,1; their sum is 22. Context-switch overhead is not supplied and is therefore excluded. Arrival of P3 at time 2 does not preempt P2, whose remaining burst is only 2.

Original paper, page 6