{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture07 - CS140 Winter 2008 Handout#7 Today's big...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS140 - Winter 2008 - Handout #7 1 Mendel Rosenblum CS 140: Operating Systems Lecture 7: Adv. Scheduling Today’s big adventure Multi-level feedback in the real world Unix Lottery scheduling: Clever use of randomness to get simplicity Retro-perspectives on scheduling Reading: 6 th Ed. Chapter 6 7 th Ed. Chapter 5 The past FIFO: run in arrival order, until exit or block + simple - short jobs can get stuck behind long ones; poor I/O RR: run in cycle, until exit, block or time slice expires + better for short jobs - poor when jobs are the same length STCF: run shortest jobs first + optimal (ave. response time, ave. time-to-completion) - hard to predict the future. Unfair. add run run add Understanding scheduling You add the nth process to system when will it run at ~1/n of speed of CPU? < 1/n? > 1/n? Scheduling in real world Where RR used? FIFO? SJF? Hybrids? Why so much FIFO? When priorities? Time Slicing? What’s common cswitch overhead? Real world scheduling not covered by RR, FIFO, STCF? n Multi-level Unix (SysV, BSD) Priorities go from 0..127 (0 = highest priority) 32 run queues, 4 priority levels each Run highest priority job always (even if just ran) Favor jobs that haven’t run recently 0..3 4..7 8..11 .... 124..127 Multi-level in real world: Unix SVR3 Keep history of recent CPU usage for each process Give highest priority to process that has used the least CPU time “recently” Every process has two fields: p_cpu field to track usage usr_pri field to track priority Every clock tick increment current job’s p_cpu by 1 Every second recompute every job’s priority and usage p_cpu = p_cpu / 2 (escape tyranny of past!)
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
Image of page 2
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