SlideShare a Scribd company logo
BITS, PILANI – K. K. BIRLA GOA CAMPUS
Operating Systems
by
Mrs. Shubhangi Gawali
Dept. of CS and IS
1July 16, 2014
OPERATING SYSTEMS
LECTURE 11: CPU
SCHEDULING
Basic Concepts
 Maximum CPU utilization obtained with
multiprogramming.
 CPU–I/O Burst Cycle – Process
execution consists of a cycle of CPU
execution and I/O wait.
 CPU burst distribution
 Burst/Service time = total processor
time needed in one CPU-I/O burst cycle.
3July 16, 2014
4
Alternating Sequence of CPU And I/O Bursts
July 16, 2014
Processes
 Processes can be described as either:
 CPU-bound process – spends more time doing computations; few very
long CPU bursts
 I/O-bound process – spends more time doing I/O than computations,
many short CPU bursts
5July 16, 2014
6July 16, 2014
7July 16, 2014
Schedulers
 Long-term scheduler (or job scheduler)
 Selects which processes should be brought into the
ready queue
 Controls the degree of multiprogramming
 More processes, smaller percentage of time each
process is executed
 Short-term scheduler (or CPU scheduler)
 Selects which process should be executed next and
allocates
 Known as the dispatcher & Executes most frequently
 Invoked when an event occurs
 Clock interrupts, I/O interrupts, OS calls, Signals, CPU
July 16, 2014 8
Addition of Medium Term Scheduling
 Part of the swapping function
 Based on the need to manage the degree of
multiprogramming
July 16, 2014 9
July 16, 2014 10
July 16, 2014 11
Schedulers (Cont)
 Short-term scheduler is invoked very frequently
(milliseconds) ⇒ (must be fast)
 CPU scheduler: selects from among the processes in memory
that are ready to execute, and allocates the CPU to one of them
 Long-term scheduler is invoked very infrequently
(seconds, minutes) ⇒ (may be slow)
July 16, 2014 12
 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
 Scheduling under 1 and 4
is nonpreemptive
 All other are preemptive
July 16, 2014 13
Characterization of Scheduling Policies
 The selection function: determines which process in the
ready queue is selected next for execution.
 The decision mode: specifies the instants in time at
which the selection function is exercised.
 Nonpreemptive:
 Once a process is in the running state, it will continue until it
terminates or blocks itself for I/O.
 Preemptive:
 Currently running process may be interrupted and moved to
the Ready state by the OS.
 Allows for better service since any one process cannot
monopolize the processor for very long.
July 16, 2014 14
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
July 16, 2014 15
16July 16, 2014
Process Control Block Contains
 Run state and
scheduling
 Memory management
information
 Hardware state
 Signaling
 Access control
 Input and output
 Process id
 Parent process id
 Child process ids
 Process group id(s)
 User id
 Effective user id
 Group id(s)
 Effective group id(s)
July 16, 2014 17
•Account id
•Priority level
•Elapsed CPU time
•Start time
•Scheduled start time
•Maximum cpu time
•Memory allocation
Scheduling Criteria CPU utilization: amount of time in percentage that a
processor is busy.
 Throughput: No of processes completed per time unit.
 Turnaround time: the interval from time of submission to
the time of completion (execution + waiting for
resources/processor)
 Waiting time: sum of periods spent waiting in the ready
queue
 Response time: time from submission of a request until
the first response is produced.
 Deadline: Maximize no of processes meeting their
deadlines ( imp for real time systems)
18July 16, 2014
Scheduling Algorithm Optimization Criteria
 Max CPU utilization
 Max throughput
 Min turnaround time
 Min waiting time
 Min response time
19July 16, 2014
20
CPU Scheduling Criteria
 User-oriented
 Response Time
 Elapsed time between the submission of a request until
there is output.
 System-oriented
 Effective and efficient utilization of the processor
 Performance-related
 Quantitative
 Measurable such as response time and throughput
July 16, 2014

More Related Content

What's hot (20)

PPTX
Cpu scheduling in operating System.
Ravi Kumar Patel
 
PDF
Operating System-Process Scheduling
Shipra Swati
 
PDF
Deadlock Avoidance - OS
MsAnita2
 
PDF
Deadlock
Mohd Arif
 
PDF
operating system structure
Waseem Ud Din Farooqui
 
DOCX
Amdahl`s law -Processor performance
COMSATS Institute of Information Technology
 
PPTX
Buffering.pptx
HarleenKaur183313
 
PPTX
Multiprogramming&timesharing
Tanuj Tyagi
 
PPT
Operating System: Deadlock
InteX Research Lab
 
PPT
Process management in os
Miong Lazaro
 
PPT
Operating Systems Process Scheduling Algorithms
sathish sak
 
PPTX
Cpu scheduling
Abhijith Reloaded
 
PPT
Operating Systems - "Chapter 5 Process Synchronization"
Ra'Fat Al-Msie'deen
 
PDF
Lecture 2 more about parallel computing
Vajira Thambawita
 
PDF
OS - Process Concepts
Mukesh Chinta
 
PPTX
INSTRUCTION LEVEL PARALLALISM
Kamran Ashraf
 
PPTX
MULTILEVEL QUEUE SCHEDULING
garishma bhatia
 
PPTX
Scheduling
pradeepa velmurugan
 
PPTX
Process scheduling
Deepika Balichwal
 
PPTX
Cpu scheduling
Karthick Sekar
 
Cpu scheduling in operating System.
Ravi Kumar Patel
 
Operating System-Process Scheduling
Shipra Swati
 
Deadlock Avoidance - OS
MsAnita2
 
Deadlock
Mohd Arif
 
operating system structure
Waseem Ud Din Farooqui
 
Amdahl`s law -Processor performance
COMSATS Institute of Information Technology
 
Buffering.pptx
HarleenKaur183313
 
Multiprogramming&timesharing
Tanuj Tyagi
 
Operating System: Deadlock
InteX Research Lab
 
Process management in os
Miong Lazaro
 
Operating Systems Process Scheduling Algorithms
sathish sak
 
Cpu scheduling
Abhijith Reloaded
 
Operating Systems - "Chapter 5 Process Synchronization"
Ra'Fat Al-Msie'deen
 
Lecture 2 more about parallel computing
Vajira Thambawita
 
OS - Process Concepts
Mukesh Chinta
 
INSTRUCTION LEVEL PARALLALISM
Kamran Ashraf
 
MULTILEVEL QUEUE SCHEDULING
garishma bhatia
 
Process scheduling
Deepika Balichwal
 
Cpu scheduling
Karthick Sekar
 

Similar to cpu scheduling OS (20)

PPTX
Lecture 4 - Process Scheduling (1).pptx
Amanuelmergia
 
PPTX
Lecture 4 - Process Scheduling.pptx
Amanuelmergia
 
PPTX
Operating system 28 fundamental of scheduling
Vaibhav Khanna
 
PPTX
CPU Scheduling_in_processManagement.pptx
ezekielnyamu1
 
PDF
CPU Scheduling Part-I.pdf
Harika Pudugosula
 
PPTX
topic cpu scheduling in operating system.pptx
iotsaprofessor
 
PPTX
Scheduling Definition, objectives and types
Maitree Patel
 
PPTX
UNIPROCESS SCHEDULING.pptx
ansariparveen06
 
PPT
Operating System.ppt
NitihyaAshwinC
 
PPTX
2_CPU Scheduling (2)beautifulgameyt.pptx
adeljoby2004
 
PPTX
Schudling os presentaion
inayat khan
 
PDF
Lecture 3 CPU scheduling_2.pdflllllllllll
MohamedPalastine
 
PDF
Lecture 3 CPU scheduling.pdfvgukgiolphpiphjp
MohamedPalastine
 
PPTX
(CPU Scheduling) in operating systems.pptx
shujatssc
 
PPT
Process Basics.ppt
CharuJain396881
 
PPT
Introduction of cpu scheduling in operating system
kundansingh1642004
 
PPT
MODULE 2 for the cpu shcheduling and.ppt
adityaraj822269
 
PPTX
Os unit 3 , process management
Arnav Chowdhury
 
PPT
May14ProcessScheduling.ppt
ansariparveen06
 
PPT
pscheduling.ppt
ansariparveen06
 
Lecture 4 - Process Scheduling (1).pptx
Amanuelmergia
 
Lecture 4 - Process Scheduling.pptx
Amanuelmergia
 
Operating system 28 fundamental of scheduling
Vaibhav Khanna
 
CPU Scheduling_in_processManagement.pptx
ezekielnyamu1
 
CPU Scheduling Part-I.pdf
Harika Pudugosula
 
topic cpu scheduling in operating system.pptx
iotsaprofessor
 
Scheduling Definition, objectives and types
Maitree Patel
 
UNIPROCESS SCHEDULING.pptx
ansariparveen06
 
Operating System.ppt
NitihyaAshwinC
 
2_CPU Scheduling (2)beautifulgameyt.pptx
adeljoby2004
 
Schudling os presentaion
inayat khan
 
Lecture 3 CPU scheduling_2.pdflllllllllll
MohamedPalastine
 
Lecture 3 CPU scheduling.pdfvgukgiolphpiphjp
MohamedPalastine
 
(CPU Scheduling) in operating systems.pptx
shujatssc
 
Process Basics.ppt
CharuJain396881
 
Introduction of cpu scheduling in operating system
kundansingh1642004
 
MODULE 2 for the cpu shcheduling and.ppt
adityaraj822269
 
Os unit 3 , process management
Arnav Chowdhury
 
May14ProcessScheduling.ppt
ansariparveen06
 
pscheduling.ppt
ansariparveen06
 
Ad

Recently uploaded (20)

PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PPTX
prodad heroglyph crack 2.0.214.2 Full Free Download
cracked shares
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
PDF
Show Which Projects Support Your Strategy and Deliver Results with OnePlan df
OnePlan Solutions
 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
PPTX
Build a Custom Agent for Agentic Testing.pptx
klpathrudu
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
PDF
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PDF
Best Web development company in india 2025
Greenusys
 
PDF
NPD Software -Omnex systems
omnex systems
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
From spreadsheets and delays to real-time control
SatishKumar2651
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
prodad heroglyph crack 2.0.214.2 Full Free Download
cracked shares
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
Show Which Projects Support Your Strategy and Deliver Results with OnePlan df
OnePlan Solutions
 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
Build a Custom Agent for Agentic Testing.pptx
klpathrudu
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Best Web development company in india 2025
Greenusys
 
NPD Software -Omnex systems
omnex systems
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
From spreadsheets and delays to real-time control
SatishKumar2651
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Ad

cpu scheduling OS

  • 1. BITS, PILANI – K. K. BIRLA GOA CAMPUS Operating Systems by Mrs. Shubhangi Gawali Dept. of CS and IS 1July 16, 2014
  • 3. Basic Concepts  Maximum CPU utilization obtained with multiprogramming.  CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait.  CPU burst distribution  Burst/Service time = total processor time needed in one CPU-I/O burst cycle. 3July 16, 2014
  • 4. 4 Alternating Sequence of CPU And I/O Bursts July 16, 2014
  • 5. Processes  Processes can be described as either:  CPU-bound process – spends more time doing computations; few very long CPU bursts  I/O-bound process – spends more time doing I/O than computations, many short CPU bursts 5July 16, 2014
  • 8. Schedulers  Long-term scheduler (or job scheduler)  Selects which processes should be brought into the ready queue  Controls the degree of multiprogramming  More processes, smaller percentage of time each process is executed  Short-term scheduler (or CPU scheduler)  Selects which process should be executed next and allocates  Known as the dispatcher & Executes most frequently  Invoked when an event occurs  Clock interrupts, I/O interrupts, OS calls, Signals, CPU July 16, 2014 8
  • 9. Addition of Medium Term Scheduling  Part of the swapping function  Based on the need to manage the degree of multiprogramming July 16, 2014 9
  • 12. Schedulers (Cont)  Short-term scheduler is invoked very frequently (milliseconds) ⇒ (must be fast)  CPU scheduler: selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them  Long-term scheduler is invoked very infrequently (seconds, minutes) ⇒ (may be slow) July 16, 2014 12
  • 13.  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  Scheduling under 1 and 4 is nonpreemptive  All other are preemptive July 16, 2014 13
  • 14. Characterization of Scheduling Policies  The selection function: determines which process in the ready queue is selected next for execution.  The decision mode: specifies the instants in time at which the selection function is exercised.  Nonpreemptive:  Once a process is in the running state, it will continue until it terminates or blocks itself for I/O.  Preemptive:  Currently running process may be interrupted and moved to the Ready state by the OS.  Allows for better service since any one process cannot monopolize the processor for very long. July 16, 2014 14
  • 15. 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 July 16, 2014 15
  • 17. Process Control Block Contains  Run state and scheduling  Memory management information  Hardware state  Signaling  Access control  Input and output  Process id  Parent process id  Child process ids  Process group id(s)  User id  Effective user id  Group id(s)  Effective group id(s) July 16, 2014 17 •Account id •Priority level •Elapsed CPU time •Start time •Scheduled start time •Maximum cpu time •Memory allocation
  • 18. Scheduling Criteria CPU utilization: amount of time in percentage that a processor is busy.  Throughput: No of processes completed per time unit.  Turnaround time: the interval from time of submission to the time of completion (execution + waiting for resources/processor)  Waiting time: sum of periods spent waiting in the ready queue  Response time: time from submission of a request until the first response is produced.  Deadline: Maximize no of processes meeting their deadlines ( imp for real time systems) 18July 16, 2014
  • 19. Scheduling Algorithm Optimization Criteria  Max CPU utilization  Max throughput  Min turnaround time  Min waiting time  Min response time 19July 16, 2014
  • 20. 20 CPU Scheduling Criteria  User-oriented  Response Time  Elapsed time between the submission of a request until there is output.  System-oriented  Effective and efficient utilization of the processor  Performance-related  Quantitative  Measurable such as response time and throughput July 16, 2014

Editor's Notes

  • #6: Jobs with long CPU burst time are CPU-bound jobs and are also referred to as “long jobs”. Jobs with short CPU burst time are IO-bound jobs and are also referred to as “short jobs”. CPU-bound processes have longer CPU bursts than I/O-bound processes.