SlideShare uma empresa Scribd logo
1 de 14
SHORTEST
REMAINING
TIME
FIRST(SRTF)
INDEX
INTRODUCTION
WORKING
ADVANTAGES
LIMITATIONS
EXAMPLES
COMPARISON
IMPLEMENTATION
CONCLUSION
INTRODUCTION
Welcome to this presentation on the shortest remaining time first
(SRTF) scheduling algorithm. In today's fast-paced world, computer
systems are required to handle an ever-increasing number of processes,
often with limited resources. This is where CPU scheduling comes in -
it is a method used by operating systems to manage the allocation of
the CPU among processes.
SRTF is one of several CPU scheduling algorithms that are used to
manage processes in a computer system. It is designed to prioritize
shorter processes, which can lead to higher throughput and shorter
turnaround times.
In this presentation, we will explore how the SRTF algorithm works, its
advantages and limitations, and how it can be implemented in practice.
We will also compare SRTF with other scheduling algorithms and
provide examples of SRTF scheduling in action.
Let's dive into the world of CPU scheduling with SRTF!
Presentation title 4
WORKING(SRTF ALGORITHM)
5
1. The shortest remaining time first (SRTF) scheduling algorithm is a preemptive CPU
scheduling algorithm that selects the process with the smallest amount of remaining
CPU burst time to execute next. The basic idea is to prioritize shorter processes, which
can help to reduce the average waiting time of processes in the ready queue.
2. The SRTF algorithm works by keeping track of the remaining CPU burst time for each
process in the ready queue. When a new process arrives or a running process is
preempted, the algorithm selects the process with the smallest remaining CPU burst
time to execute next.
3. If a process with a shorter remaining CPU burst time arrives while a process is already
executing, the currently executing process is preempted, and the shorter process is
executed instead. This ensures that the shortest process always has priority.
4. Once a process completes its CPU burst, it is removed from the system, and the next
shortest process in the ready queue is selected. This process continues until all
processes have completed.
5. It's important to note that SRTF scheduling is a preemptive algorithm, which means
that a currently running process can be interrupted if a shorter process arrives. This
allows for better prioritization of shorter processes but can also lead to more frequent
context switches, which can impact system performance.
6
ADVANTAGES
1.Prioritizes shorter processes: SRTF scheduling prioritizes processes
with shorter CPU burst times, which can help to reduce the average
waiting time of processes in the ready queue. This can lead to higher
throughput and shorter turnaround times.
2.Efficient use of CPU time: SRTF scheduling ensures that the shortest
process always has priority, which can lead to more efficient use of
CPU time. This is because shorter processes can complete more
quickly, freeing up the CPU for other processes.
3.Fairness: SRTF scheduling ensures that shorter processes are given
priority, which can help to ensure fairness in the allocation of CPU
time. This can be especially important in systems where processes
have different levels of priority.
4.Low response time: SRTF scheduling can help to reduce the
response time of processes. This is because shorter processes are
executed first, and therefore, they can complete more quickly and
return a response to the user more rapidly.
LIMITATIONS
1.Possibility of starvation: SRTF scheduling prioritizes shorter processes, which means
that longer processes may be left waiting indefinitely. This can lead to a situation known
as starvation, where a process is never allowed to execute, even though it is important.
2.High context switch overhead: SRTF scheduling is a preemptive algorithm, which
means that a currently running process can be interrupted if a shorter process arrives.
This can lead to more frequent context switches, which can impact system performance.
3.Difficulty in predicting CPU burst time: SRTF scheduling relies on accurate
predictions of the remaining CPU burst time for each process. However, it can be
difficult to accurately predict CPU burst times, which can lead to inefficiencies in the
scheduling algorithm.
4.Complexity: SRTF scheduling is more complex than some other scheduling
algorithms, which can make it more difficult to implement and maintain.
EXAMPLES(REAL WORD)
Operating systems: Many operating systems use SRTF scheduling or variants
of it, such as the shortest job next (SJN) algorithm, to manage the allocation of
CPU time among processes.
Web servers: SRTF scheduling has been used in web servers to prioritize
requests with shorter response times, such as simple HTML requests, over
requests with longer response times, such as database queries.
Traffic management: SRTF scheduling has been used in traffic management
systems to prioritize shorter routes over longer ones, which can help to reduce
congestion and improve traffic flow.
Manufacturing: SRTF scheduling has been used in manufacturing systems to
prioritize shorter production runs, which can help to improve efficiency and
reduce downtime.
Presentation title 8
COMPARISON
Presentation title 9
• The implementation of the shortest remaining time first (SRTF) scheduling algorithm involves the
following steps:
1. Maintain a ready queue: Processes that are ready to run are placed in a queue, called the ready
queue.
2. Calculate remaining CPU burst time: The remaining CPU burst time for each process is calculated
based on its previous CPU burst time and the total time it has spent waiting in the ready queue.
3. Select the shortest process: The process with the shortest remaining CPU burst time is selected for
execution. If multiple processes have the same shortest remaining CPU burst time, the process that
arrived first is selected.
4. Preempt the current process: If a process with a shorter remaining CPU burst time arrives while a
process is executing, the current process is preempted and placed back into the ready queue.
5. Execute the selected process: The selected process is executed until its CPU burst time is complete
or it is preempted by a shorter process.
6. Repeat the process: Steps 2-5 are repeated until all processes have completed their execution.
IMPLEMENTATION
10
• The implementation of the shortest remaining time first (SRTF) scheduling
algorithm involves the following steps:
• Maintain a ready queue: Processes that are ready to run are placed in a queue,
called the ready queue.
• Calculate remaining CPU burst time: The remaining CPU burst time for each
process is calculated based on its previous CPU burst time and the total time it
has spent waiting in the ready queue.
• Select the shortest process: The process with the shortest remaining CPU burst
time is selected for execution. If multiple processes have the same shortest
remaining CPU burst time, the process that arrived first is selected.
• Preempt the current process: If a process with a shorter remaining CPU burst
time arrives while a process is executing, the current process is preempted and
placed back into the ready queue.
• Execute the selected process: The selected process is executed until its CPU
burst time is complete or it is preempted by a shorter process.
• Repeat the process: Steps 2-5 are repeated until all processes have completed
their execution.
11
Process ID Arrival time Burst Time
P1 0 8
P2 1 4
P3 2 9
GANTT CHART
P1 P1 P1 P1 P2 P2 P2 P2 P3 P3 P3 P3 P3 P3 P3 P3 P3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
12
Process Arrival
Time
Burst Time Completio
n time
Waiting
time
P1 0 8 4 4 0
P2 1 4 8 7 3
P3 2 9 17 15 6
Average Waiting Time = (0 + 3 + 6) / 3 = 3
Average Turnaround Time = (4 + 7 + 15) / 3 = 8.67
CONCLUSION
Presentation title 13
The shortest remaining time first (SRTF) scheduling algorithm is a
powerful tool for optimizing the allocation of CPU time in computer
systems. By prioritizing shorter processes based on their remaining
CPU burst time, SRTF scheduling can help to reduce waiting times,
improve efficiency, and ensure fairness in the allocation of CPU time.
Compared to other scheduling algorithms, SRTF scheduling stands out
by its ability to prioritize shorter processes, which is particularly useful
in systems with a mix of short and long processes. Although SRTF
scheduling may not be suitable for all systems and situations, it remains
a popular and effective scheduling algorithm in many real-world
applications. Whether you're developing an operating system,
managing a web server, or optimizing a manufacturing process, SRTF
scheduling can help to improve performance and efficiency. With its
clear benefits and proven track record, SRTF scheduling is an
important tool for anyone involved in computer systems and processes.
THANK YOU
Raunak kumar jha-30
Tushar Kumar-40
Atharva Pawar-59
Siddharth Jain-27
Chhayank Indoria-25

Mais conteúdo relacionado

Semelhante a cospptagain.pptx

Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfRakibul Rakib
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Shreya Kumar
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptxDivyaKS18
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptxjamilaltiti1
 
An Improved Round Robin CPU Scheduling Algorithm with Varying Time Quantum
An Improved Round Robin CPU Scheduling Algorithm with Varying Time QuantumAn Improved Round Robin CPU Scheduling Algorithm with Varying Time Quantum
An Improved Round Robin CPU Scheduling Algorithm with Varying Time QuantumIJCSEA Journal
 
AN IMPROVED ROUND ROBIN CPU SCHEDULING ALGORITHM WITH VARYING TIME QUANTUM
AN IMPROVED ROUND ROBIN CPU SCHEDULING ALGORITHM WITH VARYING TIME QUANTUMAN IMPROVED ROUND ROBIN CPU SCHEDULING ALGORITHM WITH VARYING TIME QUANTUM
AN IMPROVED ROUND ROBIN CPU SCHEDULING ALGORITHM WITH VARYING TIME QUANTUMIJCSEA Journal
 
An improved round robin cpu scheduling
An improved round robin cpu schedulingAn improved round robin cpu scheduling
An improved round robin cpu schedulingIJCSEA Journal
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2) rohassanie
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .nathansel1
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithmsPaurav Shah
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)Harshit Jain
 

Semelhante a cospptagain.pptx (20)

Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdf
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
scheduling.pptx
scheduling.pptxscheduling.pptx
scheduling.pptx
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptx
 
An Improved Round Robin CPU Scheduling Algorithm with Varying Time Quantum
An Improved Round Robin CPU Scheduling Algorithm with Varying Time QuantumAn Improved Round Robin CPU Scheduling Algorithm with Varying Time Quantum
An Improved Round Robin CPU Scheduling Algorithm with Varying Time Quantum
 
AN IMPROVED ROUND ROBIN CPU SCHEDULING ALGORITHM WITH VARYING TIME QUANTUM
AN IMPROVED ROUND ROBIN CPU SCHEDULING ALGORITHM WITH VARYING TIME QUANTUMAN IMPROVED ROUND ROBIN CPU SCHEDULING ALGORITHM WITH VARYING TIME QUANTUM
AN IMPROVED ROUND ROBIN CPU SCHEDULING ALGORITHM WITH VARYING TIME QUANTUM
 
An improved round robin cpu scheduling
An improved round robin cpu schedulingAn improved round robin cpu scheduling
An improved round robin cpu scheduling
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
PPT CPU
PPT CPUPPT CPU
PPT CPU
 
cpu scheduling.pdf
cpu scheduling.pdfcpu scheduling.pdf
cpu scheduling.pdf
 
exp 3.docx
exp 3.docxexp 3.docx
exp 3.docx
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
 
Unit 2 notes
Unit 2 notesUnit 2 notes
Unit 2 notes
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 

Último

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 

Último (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

cospptagain.pptx

  • 1.
  • 4. INTRODUCTION Welcome to this presentation on the shortest remaining time first (SRTF) scheduling algorithm. In today's fast-paced world, computer systems are required to handle an ever-increasing number of processes, often with limited resources. This is where CPU scheduling comes in - it is a method used by operating systems to manage the allocation of the CPU among processes. SRTF is one of several CPU scheduling algorithms that are used to manage processes in a computer system. It is designed to prioritize shorter processes, which can lead to higher throughput and shorter turnaround times. In this presentation, we will explore how the SRTF algorithm works, its advantages and limitations, and how it can be implemented in practice. We will also compare SRTF with other scheduling algorithms and provide examples of SRTF scheduling in action. Let's dive into the world of CPU scheduling with SRTF! Presentation title 4
  • 5. WORKING(SRTF ALGORITHM) 5 1. The shortest remaining time first (SRTF) scheduling algorithm is a preemptive CPU scheduling algorithm that selects the process with the smallest amount of remaining CPU burst time to execute next. The basic idea is to prioritize shorter processes, which can help to reduce the average waiting time of processes in the ready queue. 2. The SRTF algorithm works by keeping track of the remaining CPU burst time for each process in the ready queue. When a new process arrives or a running process is preempted, the algorithm selects the process with the smallest remaining CPU burst time to execute next. 3. If a process with a shorter remaining CPU burst time arrives while a process is already executing, the currently executing process is preempted, and the shorter process is executed instead. This ensures that the shortest process always has priority. 4. Once a process completes its CPU burst, it is removed from the system, and the next shortest process in the ready queue is selected. This process continues until all processes have completed. 5. It's important to note that SRTF scheduling is a preemptive algorithm, which means that a currently running process can be interrupted if a shorter process arrives. This allows for better prioritization of shorter processes but can also lead to more frequent context switches, which can impact system performance.
  • 6. 6 ADVANTAGES 1.Prioritizes shorter processes: SRTF scheduling prioritizes processes with shorter CPU burst times, which can help to reduce the average waiting time of processes in the ready queue. This can lead to higher throughput and shorter turnaround times. 2.Efficient use of CPU time: SRTF scheduling ensures that the shortest process always has priority, which can lead to more efficient use of CPU time. This is because shorter processes can complete more quickly, freeing up the CPU for other processes. 3.Fairness: SRTF scheduling ensures that shorter processes are given priority, which can help to ensure fairness in the allocation of CPU time. This can be especially important in systems where processes have different levels of priority. 4.Low response time: SRTF scheduling can help to reduce the response time of processes. This is because shorter processes are executed first, and therefore, they can complete more quickly and return a response to the user more rapidly.
  • 7. LIMITATIONS 1.Possibility of starvation: SRTF scheduling prioritizes shorter processes, which means that longer processes may be left waiting indefinitely. This can lead to a situation known as starvation, where a process is never allowed to execute, even though it is important. 2.High context switch overhead: SRTF scheduling is a preemptive algorithm, which means that a currently running process can be interrupted if a shorter process arrives. This can lead to more frequent context switches, which can impact system performance. 3.Difficulty in predicting CPU burst time: SRTF scheduling relies on accurate predictions of the remaining CPU burst time for each process. However, it can be difficult to accurately predict CPU burst times, which can lead to inefficiencies in the scheduling algorithm. 4.Complexity: SRTF scheduling is more complex than some other scheduling algorithms, which can make it more difficult to implement and maintain.
  • 8. EXAMPLES(REAL WORD) Operating systems: Many operating systems use SRTF scheduling or variants of it, such as the shortest job next (SJN) algorithm, to manage the allocation of CPU time among processes. Web servers: SRTF scheduling has been used in web servers to prioritize requests with shorter response times, such as simple HTML requests, over requests with longer response times, such as database queries. Traffic management: SRTF scheduling has been used in traffic management systems to prioritize shorter routes over longer ones, which can help to reduce congestion and improve traffic flow. Manufacturing: SRTF scheduling has been used in manufacturing systems to prioritize shorter production runs, which can help to improve efficiency and reduce downtime. Presentation title 8
  • 9. COMPARISON Presentation title 9 • The implementation of the shortest remaining time first (SRTF) scheduling algorithm involves the following steps: 1. Maintain a ready queue: Processes that are ready to run are placed in a queue, called the ready queue. 2. Calculate remaining CPU burst time: The remaining CPU burst time for each process is calculated based on its previous CPU burst time and the total time it has spent waiting in the ready queue. 3. Select the shortest process: The process with the shortest remaining CPU burst time is selected for execution. If multiple processes have the same shortest remaining CPU burst time, the process that arrived first is selected. 4. Preempt the current process: If a process with a shorter remaining CPU burst time arrives while a process is executing, the current process is preempted and placed back into the ready queue. 5. Execute the selected process: The selected process is executed until its CPU burst time is complete or it is preempted by a shorter process. 6. Repeat the process: Steps 2-5 are repeated until all processes have completed their execution.
  • 10. IMPLEMENTATION 10 • The implementation of the shortest remaining time first (SRTF) scheduling algorithm involves the following steps: • Maintain a ready queue: Processes that are ready to run are placed in a queue, called the ready queue. • Calculate remaining CPU burst time: The remaining CPU burst time for each process is calculated based on its previous CPU burst time and the total time it has spent waiting in the ready queue. • Select the shortest process: The process with the shortest remaining CPU burst time is selected for execution. If multiple processes have the same shortest remaining CPU burst time, the process that arrived first is selected. • Preempt the current process: If a process with a shorter remaining CPU burst time arrives while a process is executing, the current process is preempted and placed back into the ready queue. • Execute the selected process: The selected process is executed until its CPU burst time is complete or it is preempted by a shorter process. • Repeat the process: Steps 2-5 are repeated until all processes have completed their execution.
  • 11. 11 Process ID Arrival time Burst Time P1 0 8 P2 1 4 P3 2 9 GANTT CHART P1 P1 P1 P1 P2 P2 P2 P2 P3 P3 P3 P3 P3 P3 P3 P3 P3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
  • 12. 12 Process Arrival Time Burst Time Completio n time Waiting time P1 0 8 4 4 0 P2 1 4 8 7 3 P3 2 9 17 15 6 Average Waiting Time = (0 + 3 + 6) / 3 = 3 Average Turnaround Time = (4 + 7 + 15) / 3 = 8.67
  • 13. CONCLUSION Presentation title 13 The shortest remaining time first (SRTF) scheduling algorithm is a powerful tool for optimizing the allocation of CPU time in computer systems. By prioritizing shorter processes based on their remaining CPU burst time, SRTF scheduling can help to reduce waiting times, improve efficiency, and ensure fairness in the allocation of CPU time. Compared to other scheduling algorithms, SRTF scheduling stands out by its ability to prioritize shorter processes, which is particularly useful in systems with a mix of short and long processes. Although SRTF scheduling may not be suitable for all systems and situations, it remains a popular and effective scheduling algorithm in many real-world applications. Whether you're developing an operating system, managing a web server, or optimizing a manufacturing process, SRTF scheduling can help to improve performance and efficiency. With its clear benefits and proven track record, SRTF scheduling is an important tool for anyone involved in computer systems and processes.
  • 14. THANK YOU Raunak kumar jha-30 Tushar Kumar-40 Atharva Pawar-59 Siddharth Jain-27 Chhayank Indoria-25