0% found this document useful (0 votes)
22 views10 pages

Platform Lesso

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views10 pages

Platform Lesso

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

SHORTEST

REMAINING TIME
FIRST (SRTF)
PREEMPTIVE CPU SCHEDULING ALGORITHM
SRTF

• The full form of SRT is Shortest remaining time. It is also known as SJF preemptive scheduling. In this
method, the process will be allocated to the task, which is closest to its completion. This method prevents
a newer ready state process from holding the completion of an older process.
• It is the preemptive mode of SJF CPU scheduling in which resources are allocated to processes
according to the shortest remaining time
• In the SRTF scheduling algorithm, the execution of any process can be stopped after a certain amount of
time. On arrival of every process, the short-term scheduler schedules those processes from the list of
available processes & running processes that have the least remaining burst time.
• After all the processes are available in the ready queue, then, No preemption will be done and then the
algorithm will work the same as SJF scheduling.
CHARACTERISTICS OF SRT SCHEDULING METHOD:

• This method is mostly applied in batch environments where short jobs are required to
be given preference.
• This is not an ideal method to implement it in a shared system where the required CPU
time is unknown.
• Associate with each process as the length of its next CPU burst. So that operating
system uses these lengths, which helps to schedule the process with the shortest
possible time.
Advantages of SRTF
• The main advantage of the SRTF algorithm is that it makes the processing of the jobs
faster than the SJF algorithm, mentioned it’s overhead charges are not counted.
Disadvantages of SRTF
• In SRTF, the context switching is done a lot more times than in SJN due to more
consumption of the CPU's valuable time for processing. The consumed time of CPU then
adds up to its processing time and which then diminishes the advantage of fast processing
of this algorithm.
EXAMPLE1: IN THE TABLE ARRIVAL TIME AND BURST TIME IS
GIVEN, COMPUTE FOR THE AWT AND ATT OF THE GIVEN
EXAMPLE
P AT Burst CT TT WT RT
C
P1 3 4
P2 5 9
P3 8 4
P4 0 7
P5 12 6

• TT = Completion – Arrival Average TT =


• WT = TT – Burst Time Average WT =
• Response Time (RT) = Arrival in the
CPU – Actual Arrival Time
EXAMPLE1: IN THE TABLE ARRIVAL TIME AND BURST TIME IS
GIVEN, COMPUTE FOR THE AWT AND ATT OF THE GIVEN
EXAMPLE
P AT Burst CT TT WT RT
C P4 P1 P4 P2 P1 P4 P3 P1 P2 P5 P3
P1 3 4 3 11 8 4 4 P2
P2 5 9 30 25 16 16 P4 P4 P4 P1 P1 P3 P3 P5 P2
P3 8 4 3 15 7 3 3
P4 0 7 42 7 7 0 0
0 3 5 7 8 11 12 15 21
P5 12 6 21 9 3 3
30

• TT = Completion – Arrival Average TT = 11.20ms


• WT = TT – Burst Time Average WT = 5.20 ms
• Response Time (RT) = Arrival in the
CPU – Actual Arrival Time
EXAMPLE 2

P AT Burst CT TT WT RT
C
P1 0 7 • TT = Completion – Arrival
P2 1 3 • WT = TT – Burst Time
P3 3 4 • Response Time (RT) = Arrival in the
CPU – Actual Arrival Time
P

Average TT =
Average WT =
Average RT =
EXAMPLE 3
P

P AT Burst CT TT WT RT
C P
P1 0 8
P2 1 2 0
P3 4 3

• TT = Completion – Arrival
• WT = TT – Burst Time Average TT =
• Response Time (RT) = Arrival in the Average WT =
Average RT
CPU – Actual Arrival Time
EXAMPLE 4

P AT Burst CT TT WT RT
C
P1 0 8 P
P2 1 4
P
P3 2 2
P4 3 1
P5 4 3 0
P6 5 2

• TT = Completion – Arrival
• WT = TT – Burst Time
• Response Time (RT) = Arrival in the
CPU – Actual Arrival Time
REFERENCES

• https://iq.opengenus.org/types-of-cpu-scheduling-algorithms/
• https://www.includehelp.com/operating-systems/srtf-shortest-remaining-time-first-schedu
ling-algorithm.aspx
• https://www.studytonight.com/operating-system/shortest-remaining-time-first-scheduling
-algorithm
• https://ph.video.search.yahoo.com/search/video?fr=mcafee&ei=UTF-8&p=SRTF+CPU+s
cheduling+algorithm&type=E211PH714G0#id=2&vid=ce17f8d368d356c9fbe1e5f56ee7
539d&action=click

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy