Definition
A preemptive CPU scheduling technique that gives the CPU first to the process with the shortest remaining run time among the ready queue and the running process, to minimize the average waiting time
Visual IT Encyclopedia › Operating Systems › Process Management
Definition
A preemptive CPU scheduling technique that gives the CPU first to the process with the shortest remaining run time among the ready queue and the running process, to minimize the average waiting time
Setup: one CPU. P1–P4 are four programs (processes) to run. Arrival says at how many ms a process joined the line, and run time says how many ms it needs to run on the CPU to finish. Remaining time is the part of the run time that has not run yet. The time it takes to switch processes is counted as 0. (ms: a thousandth of a second)
0 / 7
Shortest Remaining Time (SRT) Scheduling
The process with the shortest remaining run time runs first. Each time a new process joins the line, it is compared with the remaining time of the running process, and if the new one is shorter, the OS stops the current process (preemption) and runs the new one. It is the preemptive version of the non-preemptive SJF.
At a bank: if a customer with 4 minutes of business left is at the counter and a customer who needs only 3 minutes arrives, the current customer is sent to the waiting seats for a moment and the short one is served first.