lec08-scheduling

lec08-scheduling - CS162 Operating Systems and Systems...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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.
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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 five, you get five 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 4
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 finishing current CPU burst Weighted toward small bursts
Background image of page 5

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

View Full DocumentRight Arrow Icon
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) » Efficient use of resources (CPU, disk, memory, etc) Fairness Share CPU among users in some equitable way
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 31

lec08-scheduling - CS162 Operating Systems and Systems...

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

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