0% found this document useful (0 votes)
469 views1 page

10 - Shortest Remaining Time Scheduling PDF

Shortest remaining time (SRT) scheduling is a preemptive scheduling algorithm where the process with the shortest estimated time to completion is selected to run next. Under SRT, the currently running process may be preempted by another process with a shorter estimated run time. An example calculates the average waiting time using SRT for three processes, P1, P2, and P3, arriving at different times with different CPU burst times. The CPU is given to the process with the least remaining time to finish.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
469 views1 page

10 - Shortest Remaining Time Scheduling PDF

Shortest remaining time (SRT) scheduling is a preemptive scheduling algorithm where the process with the shortest estimated time to completion is selected to run next. Under SRT, the currently running process may be preempted by another process with a shorter estimated run time. An example calculates the average waiting time using SRT for three processes, P1, P2, and P3, arriving at different times with different CPU burst times. The CPU is given to the process with the least remaining time to finish.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Shortest Remaining Time Scheduling

Shortest remaining time (SRT) scheduling
Shortest remaining time scheduling is the preemptive counter part of SJF and is useful in time sharing
system. In SRT, process with the smallest estimated run time to completion is run next, in SJF once a job
begin executing, it runs to completion. In SRT a running process may be preempted by a user process with
a shorter estimated run time.
Consider an example, where three processes arrived in the order P1, P2, P3 at the time mentioned below,
and then the average waiting time using SJF scheduling algorithm will be calculated as:

process CPU Burst Time Time of Arrival


p1 10 0
p2 5 1
p3 2 2

shortest remaining time scheduling

In this, the CPU will be taken away from the currently executing process whenever a process will less CPU
burst time.
As shown in figure, the time when P2 arrives P1 needs 9 millisecond more to finish. As B’s cpu burst in 5
millisecond < 9 millisecond, therefore, P1’s execution will be preempted and P2 will be executed but
against as P3 arrives P2’s execution needs 3 more millisecond where as P3 needs only 2 millisecond to
execute, thus P3 takes over P2 and so on.

Waiting time for P1 = 0+ (8­1) = 7 millisecond
Waiting time for P2 = 1+ (4­2) = 3 millisecond
Waiting time for P3 = 2 millisecond
Average waiting time = (7+3+2) / 3 = 4 millisecond

You might also like