SlideShare a Scribd company logo
1 of 3
Download to read offline
Comparison of Scheduling Algorithms
By now, you must have understood how CPU can apply different scheduling algorithms to
schedule processes. Now, let us examine the advantages and disadvantages of each scheduling
algorithm.
First Come First Serve (FCFS)
Advantages:
• FCFS algorithm doesn’t include any complex logic, it just puts the process requests in a queue
and executes it one by one.
• Hence, FCFS is pretty simple and easy to implement.
• Eventually, every process will get a chance to run, so starvation doesn’t occur.
Disadvantages:
• There is no option for pre-emption of a process. If a process is started, then CPU executes the
process until it ends.
• Because there is no pre-emption, if a process executes for a long time, the processes in the back
of the queue will have to wait for a long time before they get a chance to be executed.
Shortest Job First (SJF)
Advantages:
• According to the definition, short processes are executed first and then followed by longer
processes.
• The throughput is increased because more processes can be executed in less amount of time.
Disadvantages:
• The time taken by a process must be known by the CPU beforehand, which is not possible.
• Longer processes will have more waiting time, eventually they’ll suffer starvation.
Note: Preemptive Shortest Job First scheduling will have the same advantages and disadvantages
as those for SJF.
Round Robin (RR)
Advantages:
• Each process is served by the CPU for a fixed time quantum, so all processes are given the same
priority.
• Starvation doesn’t occur because for each round robin cycle, every process is given a fixed time
to execute. No process is left behind.
Disadvantages:
• The throughput in RR largely depends on the choice of the length of the time quantum. If time
quantum is longer than needed, it tends to exhibit the same behavior as FCFS.
• If time quantum is shorter than needed, the number of times that CPU switches from one
process to another process, increases. This leads to decrease in CPU efficiency.
Priority based Scheduling
Advantages:
• The priority of a process can be selected based on memory requirement, time requirement or
user preference. For example, a high end game will have better graphics, that means the process
which updates the screen in a game will have higher priority so as to achieve better graphics
performance.
Disadvantages:
• A second scheduling algorithm is required to schedule the processes which have same priority.
• In preemptive priority scheduling, a higher priority process can execute ahead of an already
executing lower priority process. If lower priority process keeps waiting for higher priority
processes, starvation occurs.
Usage of Scheduling Algorithms in Different Situations:
Every scheduling algorithm has a type of a situation where it is the best choice. Let’s look at
different such situations:
• Situation 1: The incoming processes are short and there is no need for the processes to execute
in a specific order.
In this case, FCFS works best when compared to SJF and RR because the processes are short
which means that no process will wait for a longer time. When each process is executed one by
one, every process will be executed eventually.
• Situation 2: The processes are a mix of long and short processes and the task will only be
completed if all the processes are executed successfully in a given time.
Round Robin scheduling works efficiently here because it does not cause starvation and also
gives equal time quantum for each process.
• Situation 3: The processes are a mix of user based and kernel based processes.
Priority based scheduling works efficiently in this case because generally kernel based processes
have higher priority when compared to user based processes.
For example, the scheduler itself is a kernel based process, it should run first so that it can
schedule other processes.

More Related Content

What's hot

CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithmsShanu Kumar
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process SchedulingDamian T. Gordon
 
Semaphores OS Basics
Semaphores OS BasicsSemaphores OS Basics
Semaphores OS BasicsShijin Raj P
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's typesNishant Joshi
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating SystemAUST
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.Ravi Kumar Patel
 
Operating System - Unit I - Introduction
Operating System - Unit I - IntroductionOperating System - Unit I - Introduction
Operating System - Unit I - Introductioncscarcas
 
Classical problem of synchronization
Classical problem of synchronizationClassical problem of synchronization
Classical problem of synchronizationShakshi Ranawat
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)nikeAthena
 
CPU scheduling
CPU schedulingCPU scheduling
CPU schedulingAmir Khan
 

What's hot (20)

SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 
Semaphores
SemaphoresSemaphores
Semaphores
 
Monitors
MonitorsMonitors
Monitors
 
Mutual exclusion and sync
Mutual exclusion and syncMutual exclusion and sync
Mutual exclusion and sync
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process Scheduling
 
Deadlock Presentation
Deadlock PresentationDeadlock Presentation
Deadlock Presentation
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Semaphores OS Basics
Semaphores OS BasicsSemaphores OS Basics
Semaphores OS Basics
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's types
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Operating System - Unit I - Introduction
Operating System - Unit I - IntroductionOperating System - Unit I - Introduction
Operating System - Unit I - Introduction
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
 
Classical problem of synchronization
Classical problem of synchronizationClassical problem of synchronization
Classical problem of synchronization
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 

Similar to Comparision of scheduling algorithms

Comparison of scheduling algorithms
Comparison of scheduling algorithmsComparison of scheduling algorithms
Comparison of scheduling algorithmslodhran-hayat
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxansariparveen06
 
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
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithmsPaurav Shah
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.pptansariparveen06
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptxDivyaKS18
 
LM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesLM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesmanideepakc
 
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
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Mukesh Chinta
 
Process Scheduling Algorithms | Interviews | Operating system
Process Scheduling Algorithms | Interviews | Operating systemProcess Scheduling Algorithms | Interviews | Operating system
Process Scheduling Algorithms | Interviews | Operating systemShivam Mitra
 

Similar to Comparision of scheduling algorithms (20)

Comparison of scheduling algorithms
Comparison of scheduling algorithmsComparison of scheduling algorithms
Comparison of scheduling algorithms
 
Operating system
Operating systemOperating system
Operating system
 
Osy ppt - Copy.pptx
Osy ppt - Copy.pptxOsy ppt - Copy.pptx
Osy ppt - Copy.pptx
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS 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.
 
scheduling.pptx
scheduling.pptxscheduling.pptx
scheduling.pptx
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
cpu scheduling.pdf
cpu scheduling.pdfcpu scheduling.pdf
cpu scheduling.pdf
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.ppt
 
pscheduling.ppt
pscheduling.pptpscheduling.ppt
pscheduling.ppt
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
 
LM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesLM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processes
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
 
scheduling
schedulingscheduling
scheduling
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
cosppt.pptx
cosppt.pptxcosppt.pptx
cosppt.pptx
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Scheduling
SchedulingScheduling
Scheduling
 
Process Scheduling Algorithms | Interviews | Operating system
Process Scheduling Algorithms | Interviews | Operating systemProcess Scheduling Algorithms | Interviews | Operating system
Process Scheduling Algorithms | Interviews | Operating system
 

More from Tanya Makkar

Colour models and sweep (2).pdf
Colour models and sweep (2).pdfColour models and sweep (2).pdf
Colour models and sweep (2).pdfTanya Makkar
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMSTanya Makkar
 
Program to reflecta triangle
Program to reflecta triangleProgram to reflecta triangle
Program to reflecta triangleTanya Makkar
 
Complete dbms notes
Complete dbms notesComplete dbms notes
Complete dbms notesTanya Makkar
 
ARBITRATION AND CONCILATION
ARBITRATION AND CONCILATIONARBITRATION AND CONCILATION
ARBITRATION AND CONCILATIONTanya Makkar
 
Dbms question paper
Dbms question paper Dbms question paper
Dbms question paper Tanya Makkar
 
ROAD SAFETY AND SAFE DRIVE
ROAD SAFETY AND SAFE DRIVE ROAD SAFETY AND SAFE DRIVE
ROAD SAFETY AND SAFE DRIVE Tanya Makkar
 
Ds inserting elem in array
Ds inserting elem in arrayDs inserting elem in array
Ds inserting elem in arrayTanya Makkar
 
Tanya makkar (5003)
Tanya makkar (5003)Tanya makkar (5003)
Tanya makkar (5003)Tanya Makkar
 

More from Tanya Makkar (11)

Metoo campaign
Metoo campaignMetoo campaign
Metoo campaign
 
Colour models and sweep (2).pdf
Colour models and sweep (2).pdfColour models and sweep (2).pdf
Colour models and sweep (2).pdf
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
 
Program to reflecta triangle
Program to reflecta triangleProgram to reflecta triangle
Program to reflecta triangle
 
Complete dbms notes
Complete dbms notesComplete dbms notes
Complete dbms notes
 
Cg A buffer.pdf
Cg A buffer.pdfCg A buffer.pdf
Cg A buffer.pdf
 
ARBITRATION AND CONCILATION
ARBITRATION AND CONCILATIONARBITRATION AND CONCILATION
ARBITRATION AND CONCILATION
 
Dbms question paper
Dbms question paper Dbms question paper
Dbms question paper
 
ROAD SAFETY AND SAFE DRIVE
ROAD SAFETY AND SAFE DRIVE ROAD SAFETY AND SAFE DRIVE
ROAD SAFETY AND SAFE DRIVE
 
Ds inserting elem in array
Ds inserting elem in arrayDs inserting elem in array
Ds inserting elem in array
 
Tanya makkar (5003)
Tanya makkar (5003)Tanya makkar (5003)
Tanya makkar (5003)
 

Recently uploaded

VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 

Recently uploaded (20)

VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 

Comparision of scheduling algorithms

  • 1. Comparison of Scheduling Algorithms By now, you must have understood how CPU can apply different scheduling algorithms to schedule processes. Now, let us examine the advantages and disadvantages of each scheduling algorithm. First Come First Serve (FCFS) Advantages: • FCFS algorithm doesn’t include any complex logic, it just puts the process requests in a queue and executes it one by one. • Hence, FCFS is pretty simple and easy to implement. • Eventually, every process will get a chance to run, so starvation doesn’t occur. Disadvantages: • There is no option for pre-emption of a process. If a process is started, then CPU executes the process until it ends. • Because there is no pre-emption, if a process executes for a long time, the processes in the back of the queue will have to wait for a long time before they get a chance to be executed. Shortest Job First (SJF) Advantages: • According to the definition, short processes are executed first and then followed by longer processes. • The throughput is increased because more processes can be executed in less amount of time. Disadvantages: • The time taken by a process must be known by the CPU beforehand, which is not possible. • Longer processes will have more waiting time, eventually they’ll suffer starvation. Note: Preemptive Shortest Job First scheduling will have the same advantages and disadvantages as those for SJF.
  • 2. Round Robin (RR) Advantages: • Each process is served by the CPU for a fixed time quantum, so all processes are given the same priority. • Starvation doesn’t occur because for each round robin cycle, every process is given a fixed time to execute. No process is left behind. Disadvantages: • The throughput in RR largely depends on the choice of the length of the time quantum. If time quantum is longer than needed, it tends to exhibit the same behavior as FCFS. • If time quantum is shorter than needed, the number of times that CPU switches from one process to another process, increases. This leads to decrease in CPU efficiency. Priority based Scheduling Advantages: • The priority of a process can be selected based on memory requirement, time requirement or user preference. For example, a high end game will have better graphics, that means the process which updates the screen in a game will have higher priority so as to achieve better graphics performance. Disadvantages: • A second scheduling algorithm is required to schedule the processes which have same priority. • In preemptive priority scheduling, a higher priority process can execute ahead of an already executing lower priority process. If lower priority process keeps waiting for higher priority processes, starvation occurs. Usage of Scheduling Algorithms in Different Situations: Every scheduling algorithm has a type of a situation where it is the best choice. Let’s look at different such situations:
  • 3. • Situation 1: The incoming processes are short and there is no need for the processes to execute in a specific order. In this case, FCFS works best when compared to SJF and RR because the processes are short which means that no process will wait for a longer time. When each process is executed one by one, every process will be executed eventually. • Situation 2: The processes are a mix of long and short processes and the task will only be completed if all the processes are executed successfully in a given time. Round Robin scheduling works efficiently here because it does not cause starvation and also gives equal time quantum for each process. • Situation 3: The processes are a mix of user based and kernel based processes. Priority based scheduling works efficiently in this case because generally kernel based processes have higher priority when compared to user based processes. For example, the scheduler itself is a kernel based process, it should run first so that it can schedule other processes.