{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec08-schedulingx4

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

Info icon This 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 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
Image of page 1

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

View Full Document Right 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 finishing 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) » Efficient use of resources (CPU, disk, memory, etc) • Fairness – Share CPU among users in some equitable way – Fairness 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
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern