SlideShare a Scribd company logo
1 of 11
CPU
SCHEDULING
By- Nitish Kumar Sandhawar
Roll-52
Id- 17049
Subject-Operating System
PRIORITY AND ROUND ROBIN
CPU SHEDULING
– CPU scheduling is a process which allows one
process to use the CPU while the execution of
another process is on hold (in waiting state) due to
due to unavailability of any resources like I/O etc,
CPU SCHEDULING CRITERIA
Throughput- Keep the CPU as busy as possible (from 0% to 100%).
CPU utilization-No. of processes that complete their execution per time unit.
Turn AroundTime-Amount of time to execute a particular
process.
Response time-Amount of time it takes from when a request was
submitted until the first
response is produced.
Waiting time-Amount of time a process has been waiting in the
ready queue.
Different Types of Scheduling Algorithm
There are two types of scheduling algorithm :-
1.Preemptive
a) Preempted SJF (In some Cases)-also called pre-emptive SJF
b) Preempted Priority (In some Cases)-also called pre-emptive
Priority
c) Round Robin
d) Multilevel Queue Scheduling
e) Multilevel Feedback Queue
–
1.Non-Preemptive
a) First Come First Serve
b) Non-Preempted SJF
PRIORITY
 The Priority scheduling algorithm is a general case of the SJF
algorithm. It is a non-Preemptive, pre-emptive algorithm and
one of the most common scheduling algorithms in batch
systems.
 Each process is assigned a priority. Process with highest priority
is to be executed first and so on. Process with same priority are
executed on FCFS basis.
 In Priority algorithm priority (p) is the inverse of the given
priority value. The larger the numeric value of priority, the lower
the priority, and vice versa.
 Priority can be decided based on memory requirements, time
Wait time of each process is as follows −
Average Wait Time: (9+5+12+0) / 4 = 6.5
Proce
ss
Wait Time : Service Time - Arrival
Time
P0 9 - 0 = 9
P1 6 - 1 = 5
P2 14 - 2 = 12
P3 0 - 0 = 0
– Advantage-
 Simplicity
 Reasonable support for priority
 Suitable for applications with varying
and resource requirement.
– Disadvantage-
 Indefinite blocking or starvation.
 A priority scheduling can leave some
priority waiting processes indefinitely
CPU.
ROUND ROBIN
 Round Robin is the preemptive process
scheduling algorithm.
 Each process is provided a fix time to execute,
it is called a quantum.
 Once a process is executed for a given time
period, it is preempted and other process
executes for a given time period.
 Context switching is used to save states of
preempted processes.
 The Round Robin scheduling is especially
Wait time of each process is as follows –
Proc
ess
Wait Time : Service Time -
Arrival Time
P0 (0 - 0) + (12 - 3) = 9
P1 (3 - 1) = 2
P2 (6 - 2) + (14 - 9) + (20 - 17) =
P3 (9 - 3) + (17 - 12) = 11
Average Wait Time: (9+2+12+11) / 4 = 8.5
Advantage-
• There is fairness since every process gets equal
CPU.
• The newly created process is added to end of ready
queue.
• A round-robin scheduler generally employs time-
sharing, giving each job a time slot or quantum.
Disadvantage-
• Very important jobs wait in line.
• Largest job take enough time for completion.
• Setting the quantum too short causes too many context
switches and lower the CPU efficiency.
• Setting the quantum too long may cause poor response
THANK
YOU FOR
YOUR PATIENCE

More Related Content

What's hot

OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Scheduling
vinay arora
 
Lecture 5, 6 and 7 cpu scheduling
Lecture 5, 6 and 7  cpu schedulingLecture 5, 6 and 7  cpu scheduling
Lecture 5, 6 and 7 cpu scheduling
Rushdi Shams
 

What's hot (20)

5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
Scheduling
SchedulingScheduling
Scheduling
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
PPT CPU
PPT CPUPPT CPU
PPT CPU
 
Operating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingOperating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - Scheduling
 
OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Scheduling
 
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round RobinComparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
 
Lecture 5, 6 and 7 cpu scheduling
Lecture 5, 6 and 7  cpu schedulingLecture 5, 6 and 7  cpu scheduling
Lecture 5, 6 and 7 cpu scheduling
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvin
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
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.
 
CPU Sheduling
CPU Sheduling CPU Sheduling
CPU Sheduling
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
 

Viewers also liked

President Trump's Border Wall Could Cost as much as $40b
President Trump's Border Wall Could Cost as much as $40bPresident Trump's Border Wall Could Cost as much as $40b
President Trump's Border Wall Could Cost as much as $40b
Homeland Security Research Corp.
 

Viewers also liked (20)

President Trump's Border Wall Could Cost as much as $40b
President Trump's Border Wall Could Cost as much as $40bPresident Trump's Border Wall Could Cost as much as $40b
President Trump's Border Wall Could Cost as much as $40b
 
Lmcp 1532.pptx task 5
Lmcp 1532.pptx task 5Lmcp 1532.pptx task 5
Lmcp 1532.pptx task 5
 
Cultura escrita y escuela rural aportes para leer y escribir en el plurigrado
Cultura escrita y escuela rural aportes para leer y escribir en el plurigradoCultura escrita y escuela rural aportes para leer y escribir en el plurigrado
Cultura escrita y escuela rural aportes para leer y escribir en el plurigrado
 
Proyecto educativo diseño gráfico
Proyecto educativo diseño gráficoProyecto educativo diseño gráfico
Proyecto educativo diseño gráfico
 
Bio it 2014-published
Bio it 2014-publishedBio it 2014-published
Bio it 2014-published
 
Resolving Conflicts and Disputes, 9 March 2017
Resolving Conflicts and Disputes, 9 March 2017Resolving Conflicts and Disputes, 9 March 2017
Resolving Conflicts and Disputes, 9 March 2017
 
[drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance![drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance!
 
Anàlisi d'una targa d'expansió 01
Anàlisi d'una targa d'expansió 01Anàlisi d'una targa d'expansió 01
Anàlisi d'una targa d'expansió 01
 
Documentary questionnaire
Documentary questionnaireDocumentary questionnaire
Documentary questionnaire
 
Proyecto de aula 11° nuevo periodo 1 11 (1)
Proyecto de aula 11°  nuevo periodo 1  11 (1)Proyecto de aula 11°  nuevo periodo 1  11 (1)
Proyecto de aula 11° nuevo periodo 1 11 (1)
 
Tally
TallyTally
Tally
 
Sara Ruiz Ardila
Sara Ruiz ArdilaSara Ruiz Ardila
Sara Ruiz Ardila
 
Revista Municipal Torremejia 08
Revista Municipal Torremejia 08Revista Municipal Torremejia 08
Revista Municipal Torremejia 08
 
Enfermedades más comunes en los gatos
Enfermedades más comunes en los gatosEnfermedades más comunes en los gatos
Enfermedades más comunes en los gatos
 
Klimastrategi
KlimastrategiKlimastrategi
Klimastrategi
 
Why React's Awesome!
Why React's Awesome!Why React's Awesome!
Why React's Awesome!
 
Raciocinio logico quantitativo
Raciocinio logico quantitativoRaciocinio logico quantitativo
Raciocinio logico quantitativo
 
Phyllis Schlafly Report 1970 June
Phyllis Schlafly Report 1970 JunePhyllis Schlafly Report 1970 June
Phyllis Schlafly Report 1970 June
 
неделя дружбы
неделя дружбынеделя дружбы
неделя дружбы
 
Imposto que gera cultura, rende benefícios
Imposto que gera cultura, rende benefíciosImposto que gera cultura, rende benefícios
Imposto que gera cultura, rende benefícios
 

Similar to scheduling algorithm

Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 
csc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdfcsc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdf
AkarshNag
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
tech2click
 
Csc4320 chapter 5 2
Csc4320 chapter 5 2Csc4320 chapter 5 2
Csc4320 chapter 5 2
pri534
 

Similar to scheduling algorithm (20)

CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling.pdf
 
CPU SCHEDULING AND DEADLOCK
CPU SCHEDULING AND	DEADLOCKCPU SCHEDULING AND	DEADLOCK
CPU SCHEDULING AND DEADLOCK
 
Distributed Operating System_2
Distributed Operating System_2Distributed Operating System_2
Distributed Operating System_2
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
scheduling Uni processor Long-term .ppt
scheduling  Uni processor Long-term .pptscheduling  Uni processor Long-term .ppt
scheduling Uni processor Long-term .ppt
 
operating system (1).pdf
operating system (1).pdfoperating system (1).pdf
operating system (1).pdf
 
Process and CPU scheduler
Process and CPU schedulerProcess and CPU scheduler
Process and CPU scheduler
 
Round-ribon algorithm presntation
Round-ribon algorithm presntationRound-ribon algorithm presntation
Round-ribon algorithm presntation
 
csc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdfcsc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdf
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
 
Scheduling
SchedulingScheduling
Scheduling
 
Operating system
Operating systemOperating system
Operating system
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
Csc4320 chapter 5 2
Csc4320 chapter 5 2Csc4320 chapter 5 2
Csc4320 chapter 5 2
 

Recently uploaded

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
KarakKing
 
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
heathfieldcps1
 
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
 

Recently uploaded (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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...
 
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Ữ Â...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
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
 
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
 
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)
 
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
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
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
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
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...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
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
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
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
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

scheduling algorithm

  • 1. CPU SCHEDULING By- Nitish Kumar Sandhawar Roll-52 Id- 17049 Subject-Operating System PRIORITY AND ROUND ROBIN
  • 2. CPU SHEDULING – CPU scheduling is a process which allows one process to use the CPU while the execution of another process is on hold (in waiting state) due to due to unavailability of any resources like I/O etc,
  • 3. CPU SCHEDULING CRITERIA Throughput- Keep the CPU as busy as possible (from 0% to 100%). CPU utilization-No. of processes that complete their execution per time unit. Turn AroundTime-Amount of time to execute a particular process. Response time-Amount of time it takes from when a request was submitted until the first response is produced. Waiting time-Amount of time a process has been waiting in the ready queue.
  • 4. Different Types of Scheduling Algorithm There are two types of scheduling algorithm :- 1.Preemptive a) Preempted SJF (In some Cases)-also called pre-emptive SJF b) Preempted Priority (In some Cases)-also called pre-emptive Priority c) Round Robin d) Multilevel Queue Scheduling e) Multilevel Feedback Queue – 1.Non-Preemptive a) First Come First Serve b) Non-Preempted SJF
  • 5. PRIORITY  The Priority scheduling algorithm is a general case of the SJF algorithm. It is a non-Preemptive, pre-emptive algorithm and one of the most common scheduling algorithms in batch systems.  Each process is assigned a priority. Process with highest priority is to be executed first and so on. Process with same priority are executed on FCFS basis.  In Priority algorithm priority (p) is the inverse of the given priority value. The larger the numeric value of priority, the lower the priority, and vice versa.  Priority can be decided based on memory requirements, time
  • 6. Wait time of each process is as follows − Average Wait Time: (9+5+12+0) / 4 = 6.5 Proce ss Wait Time : Service Time - Arrival Time P0 9 - 0 = 9 P1 6 - 1 = 5 P2 14 - 2 = 12 P3 0 - 0 = 0
  • 7. – Advantage-  Simplicity  Reasonable support for priority  Suitable for applications with varying and resource requirement. – Disadvantage-  Indefinite blocking or starvation.  A priority scheduling can leave some priority waiting processes indefinitely CPU.
  • 8. ROUND ROBIN  Round Robin is the preemptive process scheduling algorithm.  Each process is provided a fix time to execute, it is called a quantum.  Once a process is executed for a given time period, it is preempted and other process executes for a given time period.  Context switching is used to save states of preempted processes.  The Round Robin scheduling is especially
  • 9. Wait time of each process is as follows – Proc ess Wait Time : Service Time - Arrival Time P0 (0 - 0) + (12 - 3) = 9 P1 (3 - 1) = 2 P2 (6 - 2) + (14 - 9) + (20 - 17) = P3 (9 - 3) + (17 - 12) = 11 Average Wait Time: (9+2+12+11) / 4 = 8.5
  • 10. Advantage- • There is fairness since every process gets equal CPU. • The newly created process is added to end of ready queue. • A round-robin scheduler generally employs time- sharing, giving each job a time slot or quantum. Disadvantage- • Very important jobs wait in line. • Largest job take enough time for completion. • Setting the quantum too short causes too many context switches and lower the CPU efficiency. • Setting the quantum too long may cause poor response