SlideShare une entreprise Scribd logo
1  sur  14
INTRODUCTION
o The CPU scheduling is used to improve its
efficiency.
o It is used to allocate resources among competing
processes.
o Maximum CPU utilization is obtained with
multiprogramming.
• The processes which are to be executed are in ready queue.
• Every time the running process is blocked , the process in the
ready queue takes over the CPU.
o A process may be
• I/O BOUND: Involves more I/O operation. Ex : reading from
disk.
• CPU BOUND: Involves more computation. Ex : calculating the
sum of 2 numbers from memory.
PROCESS STATES
o The 3 states of a process are ready , running and
wait states.
o CPU scheduling is affected by the following set
of circumstances:
• A process switches from running to waiting state.
• A process switches from running to ready state .
• A process switches from waiting to ready state .
• A processes switches from running to terminated state.
CPU SCHEDULING CRITERIA
o CPU Utilization: Percent of time that the CPU is
busy executing a process.
o Throughput: Number of processes executed per
unit time.
o Turnaround Time: The interval of time between
submission of a process and its completion.
o Waiting Time: The amount of time the process
spends in the ready queue waiting for the CPU.
o Response Time: The time between submission
of requests and first response to the request.
First Come First Served(FCFS)
o The process which enters the queue first is
executed first.
o It is non-preemptive.
Process Arrival Service TT NTT
P1 0 6 6 1
P2 2 4 8 2
P3 4 1 7 7
P1 P2 P3
0 6 10 11
FCFS
o Advantages:
It is simple and easy to understand.
o Disadvantages:
The process with less execution time suffer.
Favours CPU bound process then I/O bound
process.
Shortest Job First(SJF)
o The process with the lowest execution time is
executed first.
o It can be either preemptive or non preemptive.
Process Arrival Service TT NTT
P1 0 6 6 1
P2 2 4 9 2.2
P3 4 1 3 3
P1 P3 P2
0 6 7 11
SJF
o Advantages:
Shortest jobs are favoured.
o Disadvantages:
When there are more number of shorter jobs,
longer jobs starve.
Priority Scheduling(PS)
o Each process is associated with priority and the
CPU is allocated to each of them based on their
priorities.
o Multiple process with same priority are dealt
using FCFS.
Process Arrival Service TT NTT
P1 0 6 6 1
P2 2 4 8 2
P3 4 1 7 7
P1 P2 P3
0 6 10 11
PS
o Advantages:
Priority scheduling provides a good mechanism
where the relative importance of each process may be
precisely defined.
o Disadvantages:
• If high priority processes use up a lot of CPU
time, lower priority processes may starve and be
postponed indefinitely.
• The situation where a process never gets
scheduled to run is called starvation.
• Another problem with priority scheduling is
deciding which process gets which priority level
assigned to it.
Round Robin(RR)
o Each process is allotted a time slot(q). After this
time has elapsed, the process is pre-empted and
added to the end of the ready queue.
o Performance of the round robin algorithm
◦ q large  FCFS
◦ q small  q must be greater than the context
switch time; otherwise, the overhead is too high
RR
Process Arrival Service TT NTT
P1 0 6 12 2
P2 2 4 8 2
P3 4 2 2 1
q=2
o Advantages:
Round robin scheduling is fair in that every process
gets an equal share of the CPU.
P1
0 62
P2
4
P3 P1
8
P2
10
P1
12
RR
o Disadvantages:
Setting the quantum too short, increases the overhead
and lowers the CPU efficiency, but setting it too long
may cause poor response to short processes.
ANALYSIS AND RESULTS
o Comparing the average turnaround time and
waiting time, the algorithms are ranked as
SJF,FCFS and PS.
o Based on average CPU utilization the algorithms
are ranked as FC,PS and SJF.
o In terms of execution speed, FCFS was found to
be consistently faster than PS and SJF.
Thus according to the performance
measure the corresponding scheduling algorithm
is recommended to the CPU.

Contenu connexe

Tendances

Tendances (20)

Process management in os
Process management in osProcess management in os
Process management in os
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)
 
Priority Scheduling
Priority Scheduling  Priority Scheduling
Priority Scheduling
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock Galvin
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Operating System Scheduling Algorithms
Operating System Scheduling AlgorithmsOperating System Scheduling Algorithms
Operating System Scheduling Algorithms
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Scheduling
SchedulingScheduling
Scheduling
 
Operating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingOperating system 31 multiple processor scheduling
Operating system 31 multiple processor scheduling
 
Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Process state in OS
Process state in OSProcess state in OS
Process state in OS
 

En vedette

Sstf scheduling.50
Sstf scheduling.50Sstf scheduling.50
Sstf scheduling.50myrajendra
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithmsShanu Kumar
 
OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Schedulingvinay arora
 

En vedette (6)

Sstf scheduling.50
Sstf scheduling.50Sstf scheduling.50
Sstf scheduling.50
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 
OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Scheduling
 
Scheduling Algorithms
Scheduling AlgorithmsScheduling Algorithms
Scheduling Algorithms
 
Page Replacement
Page ReplacementPage Replacement
Page Replacement
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 

Similaire à CPU scheduling algorithms in OS

first come first serve scheduling in os
first come first serve scheduling in os first come first serve scheduling in os
first come first serve scheduling in os mikeemukesh
 
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
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdfKp Sharma
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.pptKeyreSebre
 
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Third Unit  - Fourth Semester - EngineeringOperating Systems Third Unit  - Fourth Semester - Engineering
Operating Systems Third Unit - Fourth Semester - EngineeringYogesh Santhan
 
operating system (1).pdf
operating system (1).pdfoperating system (1).pdf
operating system (1).pdfAliyanAbbas1
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxansariparveen06
 
Scheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptxScheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptxRevathi Kmp
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Nagarajan
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process SchedulingShipra Swati
 
CPU scheduling
CPU schedulingCPU scheduling
CPU schedulingAmir Khan
 

Similaire à CPU scheduling algorithms in OS (20)

first come first serve scheduling in os
first come first serve scheduling in os first come first serve scheduling in os
first come first serve scheduling in os
 
Operating system
Operating systemOperating system
Operating system
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
Scheduling
SchedulingScheduling
Scheduling
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
Scheduling
SchedulingScheduling
Scheduling
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling.pdf
 
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Third Unit  - Fourth Semester - EngineeringOperating Systems Third Unit  - Fourth Semester - Engineering
Operating Systems Third Unit - Fourth Semester - Engineering
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
operating system (1).pdf
operating system (1).pdfoperating system (1).pdf
operating system (1).pdf
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptx
 
Scheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptxScheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptx
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 

Dernier

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
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
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
 
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
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
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
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
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
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
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
 

Dernier (20)

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
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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
 
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...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
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...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
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...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 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
 

CPU scheduling algorithms in OS

  • 1.
  • 2. INTRODUCTION o The CPU scheduling is used to improve its efficiency. o It is used to allocate resources among competing processes. o Maximum CPU utilization is obtained with multiprogramming. • The processes which are to be executed are in ready queue. • Every time the running process is blocked , the process in the ready queue takes over the CPU. o A process may be • I/O BOUND: Involves more I/O operation. Ex : reading from disk. • CPU BOUND: Involves more computation. Ex : calculating the sum of 2 numbers from memory.
  • 3. PROCESS STATES o The 3 states of a process are ready , running and wait states. o CPU scheduling is affected by the following set of circumstances: • A process switches from running to waiting state. • A process switches from running to ready state . • A process switches from waiting to ready state . • A processes switches from running to terminated state.
  • 4. CPU SCHEDULING CRITERIA o CPU Utilization: Percent of time that the CPU is busy executing a process. o Throughput: Number of processes executed per unit time. o Turnaround Time: The interval of time between submission of a process and its completion. o Waiting Time: The amount of time the process spends in the ready queue waiting for the CPU. o Response Time: The time between submission of requests and first response to the request.
  • 5. First Come First Served(FCFS) o The process which enters the queue first is executed first. o It is non-preemptive. Process Arrival Service TT NTT P1 0 6 6 1 P2 2 4 8 2 P3 4 1 7 7 P1 P2 P3 0 6 10 11
  • 6. FCFS o Advantages: It is simple and easy to understand. o Disadvantages: The process with less execution time suffer. Favours CPU bound process then I/O bound process.
  • 7. Shortest Job First(SJF) o The process with the lowest execution time is executed first. o It can be either preemptive or non preemptive. Process Arrival Service TT NTT P1 0 6 6 1 P2 2 4 9 2.2 P3 4 1 3 3 P1 P3 P2 0 6 7 11
  • 8. SJF o Advantages: Shortest jobs are favoured. o Disadvantages: When there are more number of shorter jobs, longer jobs starve.
  • 9. Priority Scheduling(PS) o Each process is associated with priority and the CPU is allocated to each of them based on their priorities. o Multiple process with same priority are dealt using FCFS. Process Arrival Service TT NTT P1 0 6 6 1 P2 2 4 8 2 P3 4 1 7 7 P1 P2 P3 0 6 10 11
  • 10. PS o Advantages: Priority scheduling provides a good mechanism where the relative importance of each process may be precisely defined. o Disadvantages: • If high priority processes use up a lot of CPU time, lower priority processes may starve and be postponed indefinitely. • The situation where a process never gets scheduled to run is called starvation. • Another problem with priority scheduling is deciding which process gets which priority level assigned to it.
  • 11. Round Robin(RR) o Each process is allotted a time slot(q). After this time has elapsed, the process is pre-empted and added to the end of the ready queue. o Performance of the round robin algorithm ◦ q large  FCFS ◦ q small  q must be greater than the context switch time; otherwise, the overhead is too high
  • 12. RR Process Arrival Service TT NTT P1 0 6 12 2 P2 2 4 8 2 P3 4 2 2 1 q=2 o Advantages: Round robin scheduling is fair in that every process gets an equal share of the CPU. P1 0 62 P2 4 P3 P1 8 P2 10 P1 12
  • 13. RR o Disadvantages: Setting the quantum too short, increases the overhead and lowers the CPU efficiency, but setting it too long may cause poor response to short processes.
  • 14. ANALYSIS AND RESULTS o Comparing the average turnaround time and waiting time, the algorithms are ranked as SJF,FCFS and PS. o Based on average CPU utilization the algorithms are ranked as FC,PS and SJF. o In terms of execution speed, FCFS was found to be consistently faster than PS and SJF. Thus according to the performance measure the corresponding scheduling algorithm is recommended to the CPU.