04-scheduling - CPU Scheduling Prof. Sirer (dr. Willem de...

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

View Full Document Right Arrow Icon
CPU Scheduling Prof. Sirer (dr. Will em de Bruijn) CS 4410 Cornell University
Background image of page 1

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

View Full DocumentRight Arrow Icon
Problem You are the cook at the state st. diner n customers continually enter and place their orders n Dishes take varying amounts of time to prepare What is your goal ? Which strategy achieves this goal?
Background image of page 2
Multitasking Operating Systems time sharing the cpu among processes
Background image of page 3

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

View Full DocumentRight Arrow Icon
Process Model Process alternates between CPU and I/O bursts n CPU-bound jobs: Long CPU bursts n I/O-bound: Short CPU bursts n I/O burst = process idle, switch to another “for free” Matrix multiply emacs emacs
Background image of page 4
CPU Scheduler Processes and threads migrate among queues n Ready queue, device wait queues, . .. Scheduler selects one from ready queue to run Which one? n 0 ready processes: run idle loop n 1 ready process: easy! n > 1 ready process: what to do? New Ready Running Exit Waiting
Background image of page 5

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

View Full DocumentRight Arrow Icon
multitasking design decisions algorithms advanced topics
Background image of page 6
Goals What are metrics that schedulers should optimize for ? n There are many, the right choice depends on the context Suppose: n You own an (expensive) container ship and have cargo across the world n You own a sweatshop, and need to evaluate workers n You own a diner and have customers queuing n You are a nurse and have to combine care and administration
Background image of page 7

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

View Full DocumentRight Arrow Icon
Scheduling Metrics Many quantitative criteria for evaluating scheduler algorithm : n CPU utilization: percentage of time the CPU is not idle n Throughput: completed processes per time unit n Turnaround time: submission to completion n Waiting time: time spent on the ready queue n Response time: response latency n Predictability: variance in any of these measures The right metric depends on the context
Background image of page 8
“The perfect scheduler” Minimize latency: response or job completion time Maximize throughput: Maximize jobs / time Maximize utilization: keep all devices busy Fairness: everyone makes progress, no one starves
Background image of page 9

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

View Full DocumentRight Arrow Icon
Task Preemption Non-preemptive n Process runs until voluntarily relinquish CPU w process blocks on an event (e.g., I/O or synchronization) w process terminates w Process periodically calls the yield() system call to give up the CPU n Only suitable for domains where processes can be trusted to relinquish the CPU Preemptive n The scheduler actively interrupts and deschedules an executing process n Required when applications cannot be trusted to yield n Incurs some overhead
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2011 for the course CS 4410 taught by Professor Vollset during the Spring '07 term at Cornell University (Engineering School).

Page1 / 38

04-scheduling - CPU Scheduling Prof. Sirer (dr. Willem de...

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

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