OSch5 - Chapter 5 CPU Scheduling CPU Scheduling 1 Outline !...

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

View Full Document Right Arrow Icon
CPU Scheduling 1 CPU Scheduling 1 Chapter 5 CPU Scheduling 2 Outline ! Basic Concepts. ! Scheduling Criteria. ! Scheduling Algorithms. ! Multiple-Processor Scheduling. ! Thread Scheduling. ! Operating Systems Examples. ! Algorithm Evaluation.
Background image of page 1

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

View Full DocumentRight Arrow Icon
CPU Scheduling 2 3 Basic Concepts ! In a single-processor, only one process can run at a time; any others must wait until the CPU is free and can be rescheduled. ! Multiprogramming is to have some process running at all times, to maximize CPU utilization. " Several processes are kept in memory at one time. " A process is executed until it must wait (for example I/O). " When one process has to wait, the operating system takes the CPU away from that process and gives the CPU to another process. ! Scheduling of this kind is a fundamental operating-system function. " Almost all computer resources are scheduled before use. " Here, we talk about CPU scheduling as it is central to operating- system design. 4 Basic Concepts (cont’d) ! Process execution consists of a cycle of CPU execution and I/O wait. " This is, processes alternate between these two states. ! Process execution generally begins with a CPU burst, followed by an I/O burst. " Which is followed by another CPU burst, and so on. " Eventually, the final CPU burst ends with a request to terminate execution.
Background image of page 2
CPU Scheduling 3 5 Basic Concepts (cont’d) ! To have a successful CPU scheduler, we have to know properties of process execution. ! The figure shows the durations of CPU bursts. " Processes generally have a large number of short CPU bursts and small number of long CPU bursts. # An I/O-bound program typically has many short CPU bursts. # A CPU-bound program might have a few long CPU bursts. 6 CPU Scheduler ! CPU scheduler (short-term scheduler) select one of the processes in the ready queue to be executed, whenever the CPU becomes idle. ! The ready queue is not necessarily a First-In, First-Out (FIFO) queue. " With various scheduling algorithms, a ready queue can be implemented as a FIFO queue, a priority queue, a tree, or simply an unordered linked list. ! However, all the processes in the ready queue are waiting for a chance to run on the CPU. " The records in the queues are generally process control blocks (PCBs) of the processes .
Background image of page 3

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

View Full DocumentRight Arrow Icon
CPU Scheduling 4 7 CPU Scheduler (cont’d) ! CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state (I/O or wait for child processes). 2. Switches from running to ready state (interrupted). 3. Switches from waiting to ready (completion of I/O). 4. Terminates. ! When scheduling takes place only under circumstances 1 and 4, we say that the scheduling scheme is nonpreemptive. " Otherwise, it is preemptive. 8 CPU Scheduler (cont’d) ! Under nonpreemptive scheduling, once the CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/01/2012 for the course CMP 426 taught by Professor Gwangs.jung during the Spring '12 term at CUNY Lehman.

Page1 / 37

OSch5 - Chapter 5 CPU Scheduling CPU Scheduling 1 Outline !...

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

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