scheduling-05 - CPU Scheduling Schedulers Process migrates...

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

View Full Document Right Arrow Icon
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
Schedulers Process migrates among several queues Device queue, job queue, ready queue Scheduler selects a process to run from these queues Long-term scheduler: load a job in memory Runs infrequently Short-term scheduler: Select ready process to run on CPU Should be fast Middle-term scheduler Reduce multiprogramming or memory consumption
Background image of page 2
Process Scheduling “process” and “thread” used interchangeably Many processes in “ready” state Which ready process to pick to run on the CPU? 0 ready processes: run idle loop 1 ready process: easy! > 1 ready process: what to do? New Ready Running Exit Waiting
Background image of page 3

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

View Full DocumentRight Arrow Icon
When does scheduler run? Non-preemptive minimum Process runs until voluntarily relinquish CPU process blocks on an event (e.g., I/O or synchronization) process terminates Preemptive minimum All of the above, plus: • Event completes: process moves from blocked to ready Timer interrupts Implementation: process can be interrupted in favor of another New Ready Running Exit Waiting
Background image of page 4
Process Model Process alternates between CPU and I/O bursts CPU-bound jobs: Long CPU bursts – I/O-bound: Short CPU bursts I/O burst = process idle, switch to another “for free” Problem: don’t know job’s type before running Matrix multiply emacs emacs
Background image of page 5

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

View Full DocumentRight Arrow Icon
Scheduling Evaluation Metrics Many quantitative criteria for evaluating scheduler algorithm : CPU utilization: percentage of time the CPU is not idle Throughput: completed processes per time unit Turnaround time: submission to completion Waiting time: time spent on the ready queue Response time: response latency Predictability: variance in any of these measures The right metric depends on the context An underlying assumption: “response time” most important for interactive jobs (I/O bound)
Background image of page 6
“The perfect CPU scheduler” Minimize latency: response or job completion time Maximize throughput: Maximize jobs / time. Maximize utilization: keep I/O devices busy. Recurring theme with OS scheduling Fairness: everyone makes progress, no one starves
Background image of page 7

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

View Full DocumentRight Arrow Icon
Problem Cases Blindness about job types I/O goes idle Optimization involves favoring jobs of type “A” over “B”. Lots of A’s?
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 02/19/2008 for the course CS 4410 taught by Professor Vollset during the Fall '07 term at Cornell University (Engineering School).

Page1 / 29

scheduling-05 - CPU Scheduling Schedulers Process migrates...

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