Shortest Remaining Time First Preemptive Scheduling
Theory
It is also called the Shortest Remaining Time First (SRTF) algorithm. In this scheduling algorithm, the process with the smallest amount of time remaining until completion is selected to execute. Since the currently executing process is the one with the shortest amount of time remaining by definition, and since that time should only reduce as execution progresses, processes will always run until they complete or a new process is added that requires a smaller amount of time.
Advantages:
Short processes are handled very quickly.
The system also requires very little overhead since it only makes a decision when a process completes or a new process is added.
When a new process is added the algorithm only needs to compare the currently executing process with the new process, ignoring all other processes currently waiting to execute.
Disadvantages:
Like shortest job first, it has the potential for process starvation.
Long processes may be held off indefinitely if short processes are continually added.
Checkout the simulation of Shortest Remaining Time First Preemptive Scheduling