• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
July 22, 2022 |9.0K Views

Shortest Remaining Time First (SRTF) Scheduling Algorithm

  Share   Like
Description
Discussion

In this video, we will discussing what is Shortest Remaining Time First (SRTF) algorithm. SRTF is one of the CPU Scheduling algorithms. Let us understand what is CPU Scheduling

What is CPU Scheduling?
The process of assigning CPU time to various processes is known as CPU Scheduling. When the CPU becomes idle, the OS selects one of the processes that are ready to be executed. The selection process is performed by the CPU scheduler. The algorithm used by the CPU Scheduler for this purpose is known as the CPU Scheduling (or Process Scheduling) Algorithm. 

What is Shortest Remaining Time First (SRTF) algorithm?
Shortest Remaining Time First (SRTF) algorithm schedules that process on the CPU which is closest to completion i.e., the process which requires the least amount of time for completion. It is a preemptive scheduling algorithm. If new processes are not entering the system, then the current process runs to completion as it has the shortest remaining burst time. However, the executing process is interrupted if a new process with shorter burst time enters the system. 

Processes with small burst time are executed quickly on the CPU. System overhead is minimal as decisions are made only when a new process arrives or the executing process terminates. When a new process arrives, the comparison is only between the executing process and the newly arrived process. It gives better turnaround time as compared to its non-preemptive counterpart (shortest job first scheduling algorithm). 

This scheduling algorithm can lead to starvation of processes which have long burst times. Performs more number of context switches as compared to its non preemptive counterpart. Requires more processing time which overrides its advantage of fast processing.

Shortest Remaining Time First (SRTF) Algorithm:
https://www.geeksforgeeks.org/introduction-of-shortest-remaining-time-first-srtf-algorithm/