ch5 - Chapter 5 CPU Scheduling Chapter Chapter 5 CPU...

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

View Full Document Right Arrow Icon
Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling
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 th Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples Java Thread Scheduling Algorithm Evaluation
Background image of page 2
5.3 Silberschatz, Galvin and Gagne ©2005 th Basic Concepts Basic Concepts Maximum CPU utilization obtained with multiprogramming. Every time one process has to wait, another process can take over the CPU CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution With a large number of short CPU bursts and a small number of long CPU bursts An I/O bound program typically has many short CPU bursts A CPU bound program might have a few long CPU 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 th Alternating Sequence of CPU And I/O Bursts Alternating Sequence of CPU And I/O Bursts
Background image of page 4
5.5 Silberschatz, Galvin and Gagne ©2005 th Histogram of CPU-burst Times Histogram of CPU-burst Times
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 th CPU Scheduler CPU Scheduler Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. The records in the queues are process control blocks (PCBs). CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state (e.g. I/O request) 2. Switches from running to ready state (e.g. an interrupt occurs) 3. Switches from waiting to ready (e.g. completion of I/O) 4. Terminates Scheduling under 1 and 4 is nonpreemptive All other scheduling is preemptive
Background image of page 6
5.7 Silberschatz, Galvin and Gagne ©2005 th CPU Scheduler CPU Scheduler Preemptive scheduling incurs a cost associated with access to shared data. We need mechanisms to coordinate access to shared data Preemption also affects the design of the OS kernel Kernel may be busy with an activity on behalf of a process. What happens if the process is preempted in the middle of changes to kernel data and the kernel needs to read or modify the same structure? Chaos. Some OSs wait either for a system call to complete or for an I/O block to take place before doing a context switch Not good for real time computing or multiprocessing The sections of code affected by interrupts must be guarded from simultaneous use. They disable interrupts at entry and reenable them at exit.
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 Silberschatz, Galvin and Gagne ©2005 th Dispatcher 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 The dispatcher should be as fast as possible
Background image of page 8
5.9
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/21/2010 for the course CS 145 taught by Professor Markjan during the Spring '10 term at Abilene Christian University.

Page1 / 58

ch5 - Chapter 5 CPU Scheduling Chapter Chapter 5 CPU...

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

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