SlideShare a Scribd company logo
1 of 20
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

cpu scheduling
cpu schedulingcpu scheduling
cpu schedulinghashim102
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithmssathish sak
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process SchedulingDamian T. Gordon
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Mukesh Chinta
 
CPU scheduling
CPU schedulingCPU scheduling
CPU schedulingAmir Khan
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.Ravi Kumar Patel
 
First Come First Serve
First Come First ServeFirst Come First Serve
First Come First ServeEdwin Makeu
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)cs19club
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)nikeAthena
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)ritu98
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process SchedulingShipra Swati
 

What's hot (20)

cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Interrupts ppt
Interrupts pptInterrupts ppt
Interrupts ppt
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process Scheduling
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
First Come First Serve
First Come First ServeFirst Come First Serve
First Come First Serve
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)
 
Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
 
Interrupts and types of interrupts
Interrupts and types of interruptsInterrupts and types of interrupts
Interrupts and types of interrupts
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 

Similar to OPERATING SYSTEMS CPU SCHEDULING

Lecture 4 - Process Scheduling (1).pptx
Lecture 4 - Process Scheduling (1).pptxLecture 4 - Process Scheduling (1).pptx
Lecture 4 - Process Scheduling (1).pptxAmanuelmergia
 
Lecture 4 - Process Scheduling.pptx
Lecture 4 - Process Scheduling.pptxLecture 4 - Process Scheduling.pptx
Lecture 4 - Process Scheduling.pptxAmanuelmergia
 
Operating system 28 fundamental of scheduling
Operating system 28 fundamental of schedulingOperating system 28 fundamental of scheduling
Operating system 28 fundamental of schedulingVaibhav Khanna
 
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Maitree Patel
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxansariparveen06
 
Schudling os presentaion
Schudling os presentaionSchudling os presentaion
Schudling os presentaioninayat khan
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process managementArnav Chowdhury
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.pptansariparveen06
 
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
 

Similar to OPERATING SYSTEMS CPU SCHEDULING (20)

Lecture 4 - Process Scheduling (1).pptx
Lecture 4 - Process Scheduling (1).pptxLecture 4 - Process Scheduling (1).pptx
Lecture 4 - Process Scheduling (1).pptx
 
Lecture 4 - Process Scheduling.pptx
Lecture 4 - Process Scheduling.pptxLecture 4 - Process Scheduling.pptx
Lecture 4 - Process Scheduling.pptx
 
Operating system 28 fundamental of scheduling
Operating system 28 fundamental of schedulingOperating system 28 fundamental of scheduling
Operating system 28 fundamental of scheduling
 
CPU Scheduling Part-I.pdf
CPU Scheduling Part-I.pdfCPU Scheduling Part-I.pdf
CPU Scheduling Part-I.pdf
 
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptx
 
Operating System.ppt
Operating System.pptOperating System.ppt
Operating System.ppt
 
Schudling os presentaion
Schudling os presentaionSchudling os presentaion
Schudling os presentaion
 
Process Basics.ppt
Process Basics.pptProcess Basics.ppt
Process Basics.ppt
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.ppt
 
pscheduling.ppt
pscheduling.pptpscheduling.ppt
pscheduling.ppt
 
scheduling
schedulingscheduling
scheduling
 
ch_scheduling (1).ppt
ch_scheduling (1).pptch_scheduling (1).ppt
ch_scheduling (1).ppt
 
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
 
Scheduling
SchedulingScheduling
Scheduling
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Process management1
Process management1Process management1
Process management1
 

Recently uploaded

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 

Recently uploaded (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 

OPERATING SYSTEMS CPU SCHEDULING

  • 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

  1. 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.