Ch5 - Chapter 5 CPU Scheduling Chapter Adapted to COP4610 by Robert van Engelen Basic Concepts s Maximum CPU utilization is obtained with

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Adapted to COP4610 by Robert van Engelen
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Basic Concepts Maximum CPU utilization is obtained with multiprogramming Several processes are kept in memory at one time When a process has to wait, the OS scheduler switches the CPU to another process Process execution consists of a cycle of CPU execution and I/O wait of varying (but usually short) durations A process alternates between a CPU burst and an I/O burst Processes have different CPU-I/O burst distributions
Background image of page 2
5.3 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Histogram of CPU-burst Times Histogram of CPU-burst Times A CPU-bound process typically has few long CPU burst An I/O-bound process typically has many short CPU burst The burst distribution in a system is important for the selection of a CPU- scheduling algorithm (exponential distribution: many more short bursts)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
5.4 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 CPU Scheduler CPU Scheduler Recall that the short-term scheduler selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them through the dispatcher CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state (e.g. I/O wait) 2. Switches from running to ready state (e.g. interrupt) 3. Switches from waiting to ready (e.g. I/O completion) 4. Terminates Scheduling under 1 and 4 is nonpreemptive ( cooperative ) All other scheduling is preemptive , where processes can be switched at any time without process cooperation Requires hardware support (timer)
Background image of page 4
5.5 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Dispatcher Dispatcher The dispatcher module gives control of the CPU to the process selected by the short-term scheduler This involves: Switching context using the context info in the PCB Switching to user mode Jumping to the proper location in the user program to restart that program (program counter is in the PCB) This incurs overhead, the dispatch latency The time it takes for the dispatcher to stop one process and start another running
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
5.6 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Dispatch Latency Dispatch Latency
Background image of page 6
5.7 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Scheduling Criteria Scheduling Criteria Criteria to consider for scheduling: CPU utilization – keep the CPU as busy as possible Throughput – # of processes that complete their execution per time unit Turnaround time – amount of time to execute a particular process Waiting time – amount of time a process has been 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)
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
5.8
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/11/2011 for the course COP 4610 taught by Professor Robertengelen during the Spring '11 term at FSU.

Page1 / 48

Ch5 - Chapter 5 CPU Scheduling Chapter Adapted to COP4610 by Robert van Engelen Basic Concepts s Maximum CPU utilization is obtained with

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online