05_process scheduling

05_process scheduling - Chapter 5: Process Scheduling...

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

View Full Document Right Arrow Icon
Chapter 5: Process Scheduling Chapter 5: Process 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 Modified by Bo Li ©2009 Operating System Concepts Chapter 5: Process Scheduling Chapter 5: Process Scheduling ± Basic Concepts ± Scheduling Criteria ± Scheduling Algorithms
Background image of page 2
5.3 Modified by Bo Li ©2009 Operating System Concepts Process Scheduling Process Scheduling ± Recall the life-cycle of a thread or process z A thread in its life time moves among queues. ± Question: How OS decide which threads to add to or remove from a queue? z CPU scheduling concerns with the Ready Queue z Other queues need to be scheduled as well, scheduling objectives and mechanisms are different
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 Modified by Bo Li ©2009 Operating System Concepts Basic Concepts Basic Concepts ± Maximum CPU utilization obtained with multiprogramming z Under a single process system, when the process is waiting for I/O, the CPU is idle ± CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait ± CPU burst distribution z From extensive measurement, this is either exponential or hyper- exponential, with a large number short CPU bursts and a small number of long CPU bursts
Background image of page 4
5.5 Modified by Bo Li ©2009 Operating System Concepts Alternating Sequence of CPU And I/O Bursts Alternating Sequence of CPU And I/O Bursts ± Execution model: programs alternate between bursts of CPU and I/O z CPU-I/O Burst Cycle: a program typically uses the CPU for some time, then does I/O, then uses CPU again z Each scheduling decision is about which job to give to the CPU for use by its next CPU burst z With time-slicing, thread may be forced to give up CPU before finishing current CPU burst
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 Modified by Bo Li ©2009 Operating System Concepts Histogram of CPU Histogram of CPU - - burst Times burst Times
Background image of page 6
5.7 Modified by Bo Li ©2009 Operating System Concepts CPU Scheduler and Dispatcher CPU Scheduler and Dispatcher ± Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them ± CPU scheduling decisions may take place when a process: z 1.Switches from running to waiting state z 2.Switches from running to ready state z 3.Switches from waiting to ready z 4.Terminates ± Dispatcher module gives control of the CPU to the process selected by the CPU scheduler; this involves: z switching context z switching to user mode z jumping to the proper location in the user program to restart that program ± Dispatch latency (overhead) – time it takes for the dispatcher to stop one process and start another running
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 Modified by Bo Li ©2009 Operating System Concepts Factors Related to CPU Scheduling Factors Related to CPU Scheduling ± There could be factors affecting the design of CPU scheduling, some are conflicting z CPU utilization – keep the CPU as busy as possible z Throughput – # of processes or jobs that complete their execution per time unit z Turnaround time – the total amount of time to execute a particular process z Waiting time – the cumulative amount of time a process has been waiting in the ready queue z
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 09/24/2010 for the course COMP 252 taught by Professor Wong during the Fall '09 term at HKUST.

Page1 / 30

05_process scheduling - Chapter 5: Process Scheduling...

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