Cs238 CPU Scheduling Dr. Alan R. Davis. CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU.

Slides:



Advertisements
Similar presentations
CPU Scheduling.
Advertisements

CH 5. CPU Scheduling Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
Chap 5 Process Scheduling. Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU–I/O Burst Cycle – Process execution consists of a.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling CS 3100 CPU Scheduling1. Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various.
Chapter 3: CPU Scheduling
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Cs238 CPU Scheduling Dr. Alan R. Davis.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5-CPU Scheduling
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Maximum CPU utilization.
Operating Systems Part III: Process Management (CPU Scheduling)
Chapter 6: CPU Scheduling
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Scheduler What is the job of.
CPU Scheduling Introduction to Operating Systems: Module 13.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
ICS Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
CMSC 421 Spring 2004 Section 0202 Part II: Process Management Chapter 6 CPU Scheduling.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 5: CPU Scheduling Basic.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU Scheduling G.Anuradha Reference : Galvin. CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
CS 143A - Principles of Operating Systems
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU SCHEDULING.
Chapter 5: CPU Scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Presentation transcript:

Cs238 CPU Scheduling Dr. Alan R. Davis

CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU utilization. A process is executed until it must wait, usually for completion of some I/O request. The OS then switches the process with another ready process which can use the CPU. Processes alternate between CPU bursts and I/O bursts.

Scheduling Algorithms What criteria should be used? CPU Utilization: keep the CPU as busy as possible Throughput: maximize the number of processes completed per unit of time Turnaround time: minimize the time interval between submission and completion of processes Waiting time: minimize the time a process remains in the waiting queue Response time: minimize the time between submission of a process and the first response

Scheduling Algorithms First-come, First-served (FCFS) Works as its name implies. Example (Process, Burst Time): (P1, 24), (P2, 3), (P3, 3) If they arrive in the order P1, P2, P3, then the average waiting time is ( )/3 = 17 If they arrive in the order P2, P3, P1, then the average waiting time is ( )/3 = 3

Scheduling Algorithms Shortest-Job-First (SJF) Choose the job with the next shortest CPU burst Example (Process, Burst Time): (P1, 6), (P2, 8), (P3, 7), (P4, 3) They are processed in the order P4, P1, P3, P2 then the average waiting time is ( )/4 = 7

Scheduling Algorithms Priority Scheduling Associate a priority with each process, and schedule the process with the highest priority next. Equal priority processes can be scheduled FCFS. SJF is priority scheduling with shorter jobs having higher priority. Example (Process, Burst Time, Priority): (P1, 10, 3), (P2, 1, 1), (P3, 2, 3), (P4, 1, 4), (P5, 5, 2) They are processed in the order P2, P5, P1, P3, P4 then the average waiting time is ( )/5 = 8.2

Scheduling Algorithms Round-Robin (RR) A fixed time quantum is chosen, then each process is given the CPU for that amount of time, then placed at the end of the queue if necessary.

Scheduling Algorithms Multilevel Queue Scheduling For example, create queues for 1. System processes 2. Interactive processes 3. Interactive editing processes 4. Batch processes 5. Student processes

Scheduling Algorithms Multilevel Feedback Queues Allows a process to move between queues

Multiple-Processor Scheduling Load sharing schedules processes among several identical processors. Each processor could have its own ready queue, but then some processors must be idle. The processors could share a single ready queue. One processor could be appointed as the scheduler for all of them (asymmetric multiprocessing).

Real-Time Scheduling Hard real-time systems are required to complete a critical task within a guaranteed amount of time. The scheduler must then know that time requirement for each process. It then either accepts or rejects the process if it can’t meet the requirement. If the system has secondary storage or virtual memory, the scheduler can not know how long the process will take.

Real-Time Scheduling A soft real-time system requires that critical processes receive priority over less important ones. The system must have priority scheduling. Steps must be taken to prevent starvation of less important processes. Priority of real-time processes must not degrade over time.

Real-Time Scheduling Dispatch Latency Dispatch latency must be low. System calls must be preemptible. Preemption points can be inserted into long duration system calls, so that a ready high priority process can be detected. Or we could make the entire kernel preemptible. We would need to make all kernel data structures protected through various synchronization mechanisms.

Algorithm Evaluation Choose the important criteria, then evaluate the various algorithms under consideration. Deterministic modeling: calculate the cost of each algorithm on a given set of input data Queuing models: measure the distribution of CPU and I/O bursts, as well as the arrival times of processes, and use formulas and concepts of queuing-network theory to calculate other quantities Simulations: program a model of the computer system, generate test data randomly Implementation: code all the algorithms, include them in the OS, and test under real conditions