05-CPU_Scheduling_I - CSE 421/521 - Operating Systems Fall...

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

View Full Document Right Arrow Icon
1 CSE 421/521 - Operating Systems Fall 2011 Tevfik Ko ş ar University at Buffalo September 13 th , 2011 Lecture - V CPU Scheduling - I 2 Roadmap • CPU Scheduling Basic Concepts Different Scheduling Algorithms • FCFS • SJF • Priority • RR 3 Basic Concepts Multiprogramming is needed for efficient CPU utilization CPU Scheduling: deciding which processes to execute when Process execution begins with a CPU burst , followed by an I/O burst • CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait 4 Alternating Sequence of CPU And I/O Bursts 5 Histogram of CPU-burst Durations 6 Process State As a process executes, it changes state new : The process is being created ready : The process is waiting to be assigned to a process running : Instructions are being executed waiting : The process is waiting for some event to occur terminated : The process has finished execution
Background image of page 1

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

View Full DocumentRight Arrow Icon
7 CPU Scheduler Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them ! short-term scheduler CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state 2. Switches from running to ready state 3. Switches from waiting to ready 4. Terminates 5. A new process arrives Scheduling under 1 and 4 is nonpreemptive/cooperative Once a process gets the CPU, keeps it until termination/switching to waiting state/release of the CPU All other scheduling is preemptive Most OS use this Cost associated with access to shared data i.e. time quota expires 8 Dispatcher • Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; Its function involves: switching context switching to user mode jumping to the proper location in the user program to restart that program Dispatch latency – time it takes for the dispatcher to stop one process and start another running 9 Scheduling Criteria • CPU utilization – keep the CPU as busy as possible --> maximize • Throughput – # of processes that complete their execution per time unit --> maximize Turnaround time
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/01/2011.

Page1 / 5

05-CPU_Scheduling_I - CSE 421/521 - Operating Systems Fall...

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

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