SlideShare a Scribd company logo
Amrita
School
of
Engineering,
Bangalore
Ms. Harika Pudugosula
Teaching Assistant
Department of Electronics & Communication Engineering
• Basic Concepts
• Scheduling Criteria
• Scheduling Algorithms
• Thread Scheduling
• Multiple-Processor Scheduling
• Real-Time CPU Scheduling
• Operating Systems Examples
• Algorithm Evaluation
2
Objectives
CPU scheduling is the basis of multiprogrammed operating systems. By
switching the CPU among processes, the operating system can make the
computer more productive
• To introduce CPU scheduling, which is the basis for multiprogrammed
operating systems
• To describe various CPU-scheduling algorithms
• To discuss evaluation criteria for selecting a CPU-scheduling algorithm for
a particular system
• To examine the scheduling algorithms of several operating systems
3
Basic Concepts
• In a single-processor system, only one process can run at a time
• Others must wait until the CPU is free and can be rescheduled
• The objective of multiprogramming is to have some process running at
all times, to maximize CPU utilization
• A process is executed until it must wait, typically for the completion of
some I/O request
• In a simple computer system, the CPU then just sits idle. All this waiting
time is wasted; no useful work is accomplished
• With multiprogramming, we try to use this time productively, maximum
CPU utilization
4
Basic Concepts
• With multiprogramming, we try to use this time productively
• Several processes are kept in memory at one time
• When one process has to wait, the operating system takes the CPU
away from that process and gives the CPU to another process
• This pattern continues...
5
Basic Concepts
• Process execution consists of a
cycle of CPU execution and I/O
wait - CPU - I/O Burst Cycle
• CPU Burst - when the process is
being executed in the CPU
• I/O Burst - when the CPU is
waiting for I/O for further exection
• CPU burst followed by I/O burst
• Eventually, the final CPU burst
ends with a system request to
terminate execution
6
Histogram of CPU-burst Times
7
• An I/O-bound program typically has many short CPU bursts
• A CPU-bound program might have a few long CPU bursts.
CPU Scheduler
• Short-term/CPU scheduler selects from among the processes in ready
queue, and allocates the CPU to one of them
• Queue may be ordered in various ways
• CPU scheduling decisions may take place when a process:
1. Switches from running to waiting state
2. Switches from running to ready state
3. Switches from waiting to ready
4. Terminates
• For situations 1 and 4, there is no choice in terms of scheduling
A new process (if one exists in the ready queue) must be selected for
execution
• However, there is a choice for situations 2 and 3
8
CPU Scheduler
• When scheduling takes place only under circumstances 1 and 4, we say
that the scheduling scheme is nonpreemptive or cooperative
• Otherwise, it is preemptive
• Under nonpreemptive scheduling, once the CPU has been allocated to
a process, the process keeps the CPU until it releases the CPU either by
terminating or by switching to the waiting state
• Under preemptive scheduling, CPU has been taken away from a
process, before the process has completed its execution or before it is
swicting to the waiting state
• Scheduling under 1 and 4 is nonpreemptive
• All other scheduling is preemptive
• Consider access to shared data
• Consider preemption while in kernel mode
• Consider interrupts occurring during crucial OS activities
9
Dispatcher
• Dispatcher module gives control of the CPU to the process selected by
the short-term scheduler; this involves:
• switching context
• switching to user mode
• jumping to the proper location in the user program to restart that
program
• Dispatch latency – time it takes for the dispatcher to stop one process
and start another running
10
Scheduling Criteria
• CPU utilization –
• keep the CPU as busy as possible
• Conceptually, CPU utilization can range from 0 to 100 percent
• In a real system, it should range from 40 percent (for a lightly loaded
system) to 90 percent (for a heavily loaded system).
• Throughput –
• Number of processes that complete their execution per time unit
• For long processes, this rate may be one process per hour
• For short transactions, it may be ten processes per second
• Turnaround time –
• amount of time to execute a particular process
• The interval from the time of submission of a process to the time of
completion is the turnaround time
11
Scheduling Criteria
• Turnaround time –
• Turnaround time is the sum of the periods spent waiting to get into
memory, waiting in the ready queue, executing on the CPU, and doing
I/O
• Waiting time –
• The CPU-scheduling algorithm does not affect the amount of time
during which a process executes or does I/O
• It affects only the amount of time that a process spends waiting in the
ready queue
• Waiting time is the sum of the periods spent waiting in the ready
queue
• Response time –
• amount of time it takes from when a request was submitted until the
first response is produced, not output (for time-sharing environment)
12
Scheduling Algorithm Optimization Criteria
• Max CPU utilization
• Max throughput
• Min turnaround time
• Min waiting time
• Min response time
13
14
References
1. Silberscatnz and Galvin, “Operating System Concepts,” Ninth Edition, John
Wiley and Sons, 2012.
15
Thank you

More Related Content

Similar to CPU Scheduling Part-I.pdf (20)

PPTX
Lecture 4 - Process Scheduling (1).pptx
Amanuelmergia
 
PPT
17 cpu scheduling and scheduling criteria
myrajendra
 
PDF
Lecture 3 CPU scheduling.pdfvgukgiolphpiphjp
MohamedPalastine
 
PDF
Lecture 3 CPU scheduling_2.pdflllllllllll
MohamedPalastine
 
PPTX
Scheduling Definition, objectives and types
Maitree Patel
 
PPT
Cpu scheduling(suresh)
Nagarajan
 
PPTX
Lecture 7 cpu scheduling
Pradeep Kumar TS
 
PPTX
CPU Scheduling_in_processManagement.pptx
ezekielnyamu1
 
PPTX
Lecture 4 process cpu scheduling
Kumbirai Junior Muzavazi
 
PPT
Scheduling topic in operating systems (OS).
phtkgmz1
 
PPT
Chapter No 4 CPU Scheduling and Algorithms.ppt
rajaghogre22
 
PPTX
(CPU Scheduling) in operating systems.pptx
shujatssc
 
PPT
Operating System.ppt
NitihyaAshwinC
 
DOCX
Unit 2 notes
sampledocs2012
 
DOCX
UNIT II - CPU SCHEDULING.docx
karthikaparthasarath
 
PPTX
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
TSha7
 
PDF
Ch6 cpu scheduling
Welly Dian Astika
 
PPTX
CPU SCHEDULING ALGORITHMS-FCFS,SJF,RR.pptx
Rajapriya82
 
PPTX
Scheduling
jasscheema
 
PPTX
Os unit 3 , process management
Arnav Chowdhury
 
Lecture 4 - Process Scheduling (1).pptx
Amanuelmergia
 
17 cpu scheduling and scheduling criteria
myrajendra
 
Lecture 3 CPU scheduling.pdfvgukgiolphpiphjp
MohamedPalastine
 
Lecture 3 CPU scheduling_2.pdflllllllllll
MohamedPalastine
 
Scheduling Definition, objectives and types
Maitree Patel
 
Cpu scheduling(suresh)
Nagarajan
 
Lecture 7 cpu scheduling
Pradeep Kumar TS
 
CPU Scheduling_in_processManagement.pptx
ezekielnyamu1
 
Lecture 4 process cpu scheduling
Kumbirai Junior Muzavazi
 
Scheduling topic in operating systems (OS).
phtkgmz1
 
Chapter No 4 CPU Scheduling and Algorithms.ppt
rajaghogre22
 
(CPU Scheduling) in operating systems.pptx
shujatssc
 
Operating System.ppt
NitihyaAshwinC
 
Unit 2 notes
sampledocs2012
 
UNIT II - CPU SCHEDULING.docx
karthikaparthasarath
 
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
TSha7
 
Ch6 cpu scheduling
Welly Dian Astika
 
CPU SCHEDULING ALGORITHMS-FCFS,SJF,RR.pptx
Rajapriya82
 
Scheduling
jasscheema
 
Os unit 3 , process management
Arnav Chowdhury
 

More from Harika Pudugosula (20)

PPTX
Artificial Neural Networks_Part-2.pptx
Harika Pudugosula
 
PPTX
Artificial Neural Networks_Part-1.pptx
Harika Pudugosula
 
PPTX
Introduction.pptx
Harika Pudugosula
 
PDF
CPU Scheduling Part-III.pdf
Harika Pudugosula
 
PDF
CPU Scheduling Part-II.pdf
Harika Pudugosula
 
PDF
Multithreaded Programming Part- III.pdf
Harika Pudugosula
 
PDF
Multithreaded Programming Part- II.pdf
Harika Pudugosula
 
PDF
Multithreaded Programming Part- I.pdf
Harika Pudugosula
 
PDF
Deadlocks Part- III.pdf
Harika Pudugosula
 
PDF
Deadlocks Part- II.pdf
Harika Pudugosula
 
PDF
Deadlocks Part- I.pdf
Harika Pudugosula
 
PDF
Memory Management Strategies - IV.pdf
Harika Pudugosula
 
PDF
Memory Management Strategies - III.pdf
Harika Pudugosula
 
PDF
Memory Management Strategies - II.pdf
Harika Pudugosula
 
PDF
Memory Management Strategies - I.pdf
Harika Pudugosula
 
PDF
Virtual Memory Management Part - II.pdf
Harika Pudugosula
 
PDF
Virtual Memory Management Part - I.pdf
Harika Pudugosula
 
PDF
Operating System Structure Part-II.pdf
Harika Pudugosula
 
PDF
Operating System Structure Part-I.pdf
Harika Pudugosula
 
PDF
Lecture-4_Process Management.pdf
Harika Pudugosula
 
Artificial Neural Networks_Part-2.pptx
Harika Pudugosula
 
Artificial Neural Networks_Part-1.pptx
Harika Pudugosula
 
Introduction.pptx
Harika Pudugosula
 
CPU Scheduling Part-III.pdf
Harika Pudugosula
 
CPU Scheduling Part-II.pdf
Harika Pudugosula
 
Multithreaded Programming Part- III.pdf
Harika Pudugosula
 
Multithreaded Programming Part- II.pdf
Harika Pudugosula
 
Multithreaded Programming Part- I.pdf
Harika Pudugosula
 
Deadlocks Part- III.pdf
Harika Pudugosula
 
Deadlocks Part- II.pdf
Harika Pudugosula
 
Deadlocks Part- I.pdf
Harika Pudugosula
 
Memory Management Strategies - IV.pdf
Harika Pudugosula
 
Memory Management Strategies - III.pdf
Harika Pudugosula
 
Memory Management Strategies - II.pdf
Harika Pudugosula
 
Memory Management Strategies - I.pdf
Harika Pudugosula
 
Virtual Memory Management Part - II.pdf
Harika Pudugosula
 
Virtual Memory Management Part - I.pdf
Harika Pudugosula
 
Operating System Structure Part-II.pdf
Harika Pudugosula
 
Operating System Structure Part-I.pdf
Harika Pudugosula
 
Lecture-4_Process Management.pdf
Harika Pudugosula
 
Ad

Recently uploaded (20)

PPTX
YSPH VMOC Special Report - Measles Outbreak Southwest US 7-20-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
PDF
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PDF
John Keats introduction and list of his important works
vatsalacpr
 
PPTX
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
Electrophysiology_of_Heart. Electrophysiology studies in Cardiovascular syste...
Rajshri Ghogare
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
ENGLISH 8 WEEK 3 Q1 - Analyzing the linguistic, historical, andor biographica...
OliverOllet
 
PDF
EXCRETION-STRUCTURE OF NEPHRON,URINE FORMATION
raviralanaresh2
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 7-20-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Basics and rules of probability with real-life uses
ravatkaran694
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
Virus sequence retrieval from NCBI database
yamunaK13
 
John Keats introduction and list of his important works
vatsalacpr
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Electrophysiology_of_Heart. Electrophysiology studies in Cardiovascular syste...
Rajshri Ghogare
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
ENGLISH 8 WEEK 3 Q1 - Analyzing the linguistic, historical, andor biographica...
OliverOllet
 
EXCRETION-STRUCTURE OF NEPHRON,URINE FORMATION
raviralanaresh2
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Ad

CPU Scheduling Part-I.pdf

  • 1. Amrita School of Engineering, Bangalore Ms. Harika Pudugosula Teaching Assistant Department of Electronics & Communication Engineering
  • 2. • Basic Concepts • Scheduling Criteria • Scheduling Algorithms • Thread Scheduling • Multiple-Processor Scheduling • Real-Time CPU Scheduling • Operating Systems Examples • Algorithm Evaluation 2
  • 3. Objectives CPU scheduling is the basis of multiprogrammed operating systems. By switching the CPU among processes, the operating system can make the computer more productive • To introduce CPU scheduling, which is the basis for multiprogrammed operating systems • To describe various CPU-scheduling algorithms • To discuss evaluation criteria for selecting a CPU-scheduling algorithm for a particular system • To examine the scheduling algorithms of several operating systems 3
  • 4. Basic Concepts • In a single-processor system, only one process can run at a time • Others must wait until the CPU is free and can be rescheduled • The objective of multiprogramming is to have some process running at all times, to maximize CPU utilization • A process is executed until it must wait, typically for the completion of some I/O request • In a simple computer system, the CPU then just sits idle. All this waiting time is wasted; no useful work is accomplished • With multiprogramming, we try to use this time productively, maximum CPU utilization 4
  • 5. Basic Concepts • With multiprogramming, we try to use this time productively • Several processes are kept in memory at one time • When one process has to wait, the operating system takes the CPU away from that process and gives the CPU to another process • This pattern continues... 5
  • 6. Basic Concepts • Process execution consists of a cycle of CPU execution and I/O wait - CPU - I/O Burst Cycle • CPU Burst - when the process is being executed in the CPU • I/O Burst - when the CPU is waiting for I/O for further exection • CPU burst followed by I/O burst • Eventually, the final CPU burst ends with a system request to terminate execution 6
  • 7. Histogram of CPU-burst Times 7 • An I/O-bound program typically has many short CPU bursts • A CPU-bound program might have a few long CPU bursts.
  • 8. CPU Scheduler • Short-term/CPU scheduler selects from among the processes in ready queue, and allocates the CPU to one of them • Queue may be ordered in various ways • CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state 2. Switches from running to ready state 3. Switches from waiting to ready 4. Terminates • For situations 1 and 4, there is no choice in terms of scheduling A new process (if one exists in the ready queue) must be selected for execution • However, there is a choice for situations 2 and 3 8
  • 9. CPU Scheduler • When scheduling takes place only under circumstances 1 and 4, we say that the scheduling scheme is nonpreemptive or cooperative • Otherwise, it is preemptive • Under nonpreemptive scheduling, once the CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state • Under preemptive scheduling, CPU has been taken away from a process, before the process has completed its execution or before it is swicting to the waiting state • Scheduling under 1 and 4 is nonpreemptive • All other scheduling is preemptive • Consider access to shared data • Consider preemption while in kernel mode • Consider interrupts occurring during crucial OS activities 9
  • 10. Dispatcher • Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves: • switching context • switching to user mode • jumping to the proper location in the user program to restart that program • Dispatch latency – time it takes for the dispatcher to stop one process and start another running 10
  • 11. Scheduling Criteria • CPU utilization – • keep the CPU as busy as possible • Conceptually, CPU utilization can range from 0 to 100 percent • In a real system, it should range from 40 percent (for a lightly loaded system) to 90 percent (for a heavily loaded system). • Throughput – • Number of processes that complete their execution per time unit • For long processes, this rate may be one process per hour • For short transactions, it may be ten processes per second • Turnaround time – • amount of time to execute a particular process • The interval from the time of submission of a process to the time of completion is the turnaround time 11
  • 12. Scheduling Criteria • Turnaround time – • Turnaround time is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the CPU, and doing I/O • Waiting time – • The CPU-scheduling algorithm does not affect the amount of time during which a process executes or does I/O • It affects only the amount of time that a process spends waiting in the ready queue • Waiting time is the sum of the periods spent waiting in the ready queue • Response time – • amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment) 12
  • 13. Scheduling Algorithm Optimization Criteria • Max CPU utilization • Max throughput • Min turnaround time • Min waiting time • Min response time 13
  • 14. 14 References 1. Silberscatnz and Galvin, “Operating System Concepts,” Ninth Edition, John Wiley and Sons, 2012.