scheduling-05 - CPU Scheduling Schedulers Process migrates...

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

View Full Document Right Arrow Icon
CPU Scheduling
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
Schedulers Process migrates among several queues Device queue, job queue, ready queue Scheduler selects a process to run from these queues Long-term scheduler: load a job in memory Runs infrequently Short-term scheduler: Select ready process to run on CPU Should be fast Middle-term scheduler Reduce multiprogramming or memory consumption
Image of page 2
Process Scheduling “process” and “thread” used interchangeably Many processes in “ready” state Which ready process to pick to run on the CPU? 0 ready processes: run idle loop 1 ready process: easy! > 1 ready process: what to do? New Ready Running Exit Waiting
Image of page 3

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

View Full Document Right Arrow Icon
When does scheduler run? Non-preemptive minimum Process runs until voluntarily relinquish CPU process blocks on an event (e.g., I/O or synchronization) process terminates Preemptive minimum All of the above, plus: Event completes: process moves from blocked to ready Timer interrupts Implementation: process can be interrupted in favor of another New Ready Running Exit Waiting
Image of page 4
Process Model Process alternates between CPU and I/O bursts CPU-bound jobs: Long CPU bursts I/O-bound: Short CPU bursts I/O burst = process idle, switch to another “for free” Problem: don’t know job’s type before running Matrix multiply emacs emacs
Image of page 5

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

View Full Document Right Arrow Icon
Scheduling Evaluation Metrics Many quantitative criteria for evaluating scheduler algorithm : CPU utilization: percentage of time the CPU is not idle Throughput: completed processes per time unit Turnaround time: submission to completion Waiting time: time spent on the ready queue Response time: response latency Predictability: variance in any of these measures The right metric depends on the context An underlying assumption: “response time” most important for interactive jobs (I/O bound)
Image of page 6
“The perfect CPU scheduler” Minimize latency: response or job completion time Maximize throughput: Maximize jobs / time. Maximize utilization: keep I/O devices busy. Recurring theme with OS scheduling Fairness: everyone makes progress, no one starves
Image of page 7

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

View Full Document Right Arrow Icon
Problem Cases Blindness about job types I/O goes idle Optimization involves favoring jobs of type “A” over “B”.
Image of page 8
Image of page 9
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