v4stanford.edu-Scheduling

v4stanford.edu-Scheduling - Scheduling http:/w w w

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

View Full Document Right Arrow Icon
http://w w w .stanford.edu/~ouster/cgi-bin/cs140-w inter12/lecture.php?topic=scheduling January 11, 2012 Scheduling Scheduling Lecture Notes for CS 140 Winter 2012 John Ousterhout Readings for this topic from Operating System Concepts : Section 3.2, Sections 5.1-5.3, Section 5.6. Resources fall into two classes: Non-preemptible: once given, it can't be reused until thread gives it back. Examples are file space, terminal, and maybe memory. Preemptible: processor or I/O channel. Can take resource away, use it for something else, then give it back later. OS makes two related kinds of decisions about resources: Allocation: who gets what. Given a set of requests for resources, which processes should be given which resources in order to make most efficient use of the resources? Scheduling: how long can they keep it. When more resources are requested than can be granted immediately, in which order should the requests be serviced? Examples are processor scheduling (one processor, many threads), memory scheduling in virtual memory systems. For the purpose of scheduling, a thread is in one of 3 states: Running Ready: waiting for CPU time Blocked: waiting for some other event (disk I/O, incoming network packet, etc.) Simple Scheduling Algorithms First-come-first-served (FCFS) scheduling (also called FIFO or non-preemptive): Keep all of the ready threads in a single list called the
Background image of page 1

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

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

Page1 / 3

v4stanford.edu-Scheduling - Scheduling http:/w w w

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

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