Group Assignment: Shortest Remaining Time First Description
Group Assignment: Shortest Remaining Time First Description
Description
Shortest Remaining Time First (SRTF) is a preemptive version of Shortest Job First (SJF) scheduling algorithm.
Similar to the SJF algorithm, it is amongst the fastest algorithms currently available. The reasoning behind that is that at the
arrival of every process, the short term scheduler schedules the process with the least remaining burst time among the list of
available processes and the running process.
Requirements
Similarly to SJF, while being the fastest scheduling algorithm suffers from the same problem: It is entirely dependent
on the burst time. In other words, both SJF and SRTF are the least optimal scheduling algorithms if the burst time is unknown.
It can be used for statistically measuring the run time characteristics of jobs, particularly if the same tasks are run repeatedly
and predictably. But once again that really isn't a viable option for short term CPU scheduling in the real world.
For example, the following Gantt chart is based upon the following data:
P1 0 8
P2 1 4
P3 2 9
p4 3 5
The average wait time in this case is ( ( 5 - 3 ) + ( 10 - 1 ) + ( 17 - 2 ) ) / 4 = 26 / 4 = 6.5 ms. ( As opposed to 7.75 ms for non-
preemptive SJF or 8.75 for FCFS. )