cpusched - Computer Science 322 Operating Systems Mount...

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

View Full Document Right Arrow Icon
Computer Science 322 Operating Systems Mount Holyoke College Spring 2008 Topic Notes: CPU Scheduling The CPU is the first of several scarce resources that we will consider. A primary function of an operating system is to determine which processes (and, in turn, users) get to utilize the CPU(s). CPU scheduling can be done at three different levels: 1. Long-term Scheduling – also known as batch scheduling. Decide which jobs/processes are allowed into the system. 2. Short-term Scheduling – or interactive scheduling. Decide from a collection of ready pro- cesses which gets the CPU next. 3. Medium-term Scheduling – or memory scheduling. Decide if/when a process should be “swapped out” or back in based on memory available. We will discuss primarily short-term scheduling here, though we will discuss all of the algorithms that may be split between between batch and interactive scheduling. For the purposes of this discussion of general scheduling algorithms, I will use the term “process” but it could also apply to threads in many cases. A typical process alternates between the need for CPU and the need for I/O service throughout its lifespan. This is called the CPU-I/O burst cycle . It is this fact that makes multiprogramming essential. When a process needs I/O, it’s good to have another process ready to move in and take advantage of the available CPU resource. The amount of time that it can make use of the CPU is known as its CPU burst time . A typical distribution of CPU burst times looks like this:
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 322 Operating Systems Spring 2008 burst duration frequency Processes may be categorized as: CPU-bound – process does not need much I/O service, almost always want the CPU I/O-bound – short CPU burst times, needs lots of I/O service Interactive – short CPU burst times, lots of time waiting for user input (keyboard, mouse) The type of processes in the system will affect the performance of scheduling algorithms. A short-term CPU scheduling decision is needed when a process: 1. switches from a running to a waiting state (non-preemptive) 2. switches from a running to a ready state (preemptive) 3. switches from a waiting to a ready state (preemptive) 4. terminates (non-preemptive) Goals of a CPU scheduler 2
Background image of page 2
CS 322 Operating Systems Spring 2008 maximize CPU Utilization – keep the CPU busy doing useful work (owner) maximize Throughput – rate of process completion (owner) minimize Turnaround Time – amount of time to execute a particular process (user) minimize Waiting Time – amount of time that a process is waiting in the ready queue (user) minimize Response Time – amount of time it takes from a process’ arrival until its first turn on the CPU (user) Response Time’s Relationship to Throughput Response Time Knee Nominal Capacity Usable capacity Knee capacity Load Load Throughput CPU Scheduling Algorithms First-Come, First-Served (FCFS) Scheduling As its name suggests, the first process to arrive gets to go first. It is a non-preemptive FIFO system.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/15/2010 for the course CS 322 taught by Professor Teresco during the Spring '08 term at Mt. Holyoke.

Page1 / 13

cpusched - Computer Science 322 Operating Systems Mount...

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

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