lec08-schedulingx4 - Goals for Today " CS162 Operating...

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

View Full Document Right Arrow Icon
Page 1 CS162 Operating Systems and Systems Programming Lecture 8 Thread Scheduling February 13, 2012 Anthony D. Joseph and Ion Stoica http://inst.eecs.berkeley.edu/~cs162 Lec 8.2 02/13/12 Anthony D. Joseph and Ion Stoica, CS162 ©UCB Spring 2012 Goals for Today • Scheduling Policy goals • Policy Options • Implementation Considerations Note: Some slides and/or pictures in the following are adapted from slides ©2005 Silberschatz, Galvin, and Gagne adapted from slides ©2005 Silberschatz, Galvin, and Gagne. Many slides generated from my lecture notes by Kubiatowicz. Lec 8.3 02/13/12 Anthony D. Joseph and Ion Stoica, CS162 ©UCB Spring 2012 CPU Scheduling • Earlier, we talked about the life-cycle of a thread – Active threads work their way from Ready queue to Running to various waiting queues. • Question: How is the OS to decide which of several threads to take off a queue? – Obvious queue to worry about is ready queue – Others can be scheduled as well, however • Scheduling : deciding which threads are given access to resources Lec 8.4 02/13/12 Anthony D. Joseph and Ion Stoica, CS162 ©UCB Spring 2012 Scheduling Assumptions • CPU scheduling big area of research in early 70 ʼ s • Many implicit assumptions for CPU scheduling: – One program per user – One thread per program – Programs are independent • Clearly, these are unrealistic but they simplify the problem so it can be solved – For instance: is “fair” about fairness among users or programs? » If I run one compilation job and you run ±ve, you get ±ve times as much CPU on many operating systems • The high-level goal: Dole out CPU time to optimize some desired parameters of system USER1 USER2 USER3 USER1 USER2 Time
Background image of page 1

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

View Full DocumentRight Arrow Icon
Page 2 Lec 8.5 02/13/12 Anthony D. Joseph and Ion Stoica, CS162 ©UCB Spring 2012 Assumption: CPU Bursts • Execution model: programs alternate between bursts of CPU and I/O – Program typically uses the CPU for some period of time, then does I/O, then uses CPU again – Each scheduling decision is about which job to give to the CPU for use by its next CPU burst – With timeslicing, thread may be forced to give up CPU before Fnishing current CPU burst Weighted toward small bursts Lec 8.6 02/13/12 Anthony D. Joseph and Ion Stoica, CS162 ©UCB Spring 2012 Scheduling Policy Goals/Criteria • Minimize Response Time – Minimize elapsed time to do an operation (or job) – Response time is what the user sees: » Time to echo a keystroke in editor » Time to compile a program • Maximize Throughput – Maximize operations (or jobs) per second – Throughput related to response time, but not identical: » Minimizing response time will lead to more context switching than if you only maximized throughput – Two parts to maximizing throughput » Minimize overhead (for example, context-switching) » EfFcient use of resources (CPU, disk, memory, etc) • ±airness – Share CPU among users in some equitable way – ±airness is not minimizing average response time: » Better average response time by making system less fair Lec 8.7 02/13/12 Anthony D. Joseph and Ion Stoica, CS162 ©UCB Spring 2012
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

lec08-schedulingx4 - Goals for Today " CS162 Operating...

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

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