20091022 - CPU Scheduling The CPU scheduling portion of an...

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

View Full Document Right Arrow Icon
CPU Scheduling The CPU scheduling portion of an operating system is con- cerned with deciding the order in which processes receive a turn on the CPU. The choice of scheduling policy can have a large impact on system performance. The objective of the CPU scheduling subsystem is to achieve “good performance”.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Types of CPU Scheduling Long-term scheduling : Determines when to admit new processes to the system. Based on desired degree of multiprogramming . Medium-term scheduling : Determines when to bring pro- cesses into main memory. Based on memory requirements of existing processes. Short-term scheduling : Determines which process to run, of those currently in main memory. Tries to optimize various performance measures.
Background image of page 2
What is “Good Performance” There are various criteria, which cannot all be optimized si- multanously. Maximize CPU utilization : Keep CPU busy as much of the time as possible. Maximize throughput : Complete as many “jobs” per unit time as possible. as possible.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Minimize waiting time : Processes should spend as little time as possible ready but not running. Minimize turnaround time : The time taken from start to completion of a process should be as small as possible. Minimize response time ; In an interactive system, the time taken to respond to user input should be as small as possible. High predictibility : The time taken to run a given job should not vary wildly due to random factors.
Background image of page 4
Minimize overhead : The time spent executing “bookkeeping” code should be as low as possible. All scheduling heuristics have overhead (collecting statistics, managing queues, performing context switches, etc.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Components of the CPU Scheduling Subsystem Ready queue: Data structure holding processes that are ready to run. Dispatcher: Performs context switches between processes that are ready to run. Short-term Scheduler: Chooses among processes that are ready to run for next to receive CPU. Medium-term Scheduler (swapper): Transfers processes between main memory and secondary storage. Long-term scheduler: Controls the introduction of new jobs into the system.
Background image of page 6
CPU Scheduler Components
Background image of page 7

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

View Full DocumentRight Arrow Icon
Behavior of a Process A process spends its life alternating between CPU bursts and I/O bursts . CPU burst: an interval in which the process executes instructions on the CPU. I/O burst: an interval in which the process is blocked waiting for I/O (or other events) to take place. A CPU-bound process spends more time in CPU bursts. An I/O-bound process spends more time in I/O bursts.
Background image of page 8
CPU and I/O Bursts
Background image of page 9

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

View Full DocumentRight Arrow Icon
Notes on Process Behavior The nature of a process (CPU-bound or I/O-bound) is generally not known in advance.
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/19/2009 for the course CSE 306 taught by Professor Kifer,m during the Spring '08 term at SUNY Stony Brook.

Page1 / 49

20091022 - CPU Scheduling The CPU scheduling portion of an...

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

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