SRTF Scheduling Examples
Shortest Remaining Time First (SRTF) scheduling is also known as Shortest Job First (SJF) with preemption. In the SRTF algorithm, any process which contains shortest remaining burst time is always executed first.
We will solve the examples of SRTF by using the following formulas, where the given information includes Process ID, Arrival Time, Burst Time, and optional I/O time
- Gets CPU First Time: It can be seen in the Gantt Chart directly, without using any formula
- Completion Time (CT): It can also be seen in the Gantt Chart directly, without using any formula
- Turnaround Time (TAT) = Completion Time (CT) − Arrival Time (AT)
- Waiting Time (WT) = Turnaround Time (TAT) − Burst Time (BT)
- Average Waiting Time (AWT) = Sum of all Waiting Times / Number of Processes
- Average Turnaround Time (ATAT) = Sum of all Turnaround Times / Number of Processes
- Response Time (RT) = First CPU Start Time − Arrival Time (AT)
Let’s explain some Examples of SRTF algorithm.
SRTF Scheduling Example 1
Consider the following table, which includes the Process, Arrival time, and burst time.

Gannt. Chart of the given example 1 is given below

The following diagram shows how to calculate the Completion Time (CT), Waiting Time (WT), Turnaround Time (TAT), Average Waiting Time (AWT), Average Turnaround Time (ATAT), and Response Time (RT).
