Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: Process Scheduling.

Slides:



Advertisements
Similar presentations
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
Advertisements

 Basic Concepts  Scheduling Criteria  Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
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.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Processes and Their Scheduling.
Chapter 3: CPU Scheduling
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.
02/06/2008CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Scheduling in Batch Systems
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.
02/04/2008CSCI 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.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Chapter 5-CPU Scheduling
A. Frank - P. Weisberg Operating Systems CPU Scheduling.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Modified from Silberschatz, Galvin and Gagne ©2009 Lecture 8 Chapter 5: CPU Scheduling.
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.
Chapter 6: CPU Scheduling
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: Process Scheduling.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Operating Systems (CS 340 D)
Operating System Principles Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
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.
CPU Scheduling Basic Concepts. Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 15 Scheduling Read Ch.
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.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: Process Scheduling.
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.
5.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 5: Process Scheduling Objectives To introduce CPU scheduling To describe various.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
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.
Purpose of Operating System Part 2 Monil Adhikari.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
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.
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.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 6: CPU Scheduling.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
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.
CPU Scheduling CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 5: CPU Scheduling
CPU Scheduling: Basic Concepts
CPU Scheduling.
Chapter 5: CPU Scheduling
Presentation transcript:

Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: Process Scheduling

5.2 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms

5.3 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various CPU-scheduling algorithms

5.4 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU–I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait  Process execution begins with a CPU burst…That is followed by an I/O burst, which is followed by another CPU burst, then another I/O burst, and so on.  Eventually, the final CPU burst ends with a system request to terminate execution

5.5 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Histogram of CPU-burst Times The curve is generally characterized as exponential or hyper exponential The durations of CPU bursts vary greatly from process to process. There is large number of short CPU bursts and a small number of long CPU bursts. An I/O-bound program >>>> has many short CPU bursts. A CPU-bound program >>>> has a few long CPU bursts

5.6 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition CPU Scheduler CPU Scheduler (/ short-term scheduler): Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them The ready queue is not necessarily a first-in, first-out (FIFO) queue. It can be implemented as a FIFO queue, a priority queue, a tree, or an unordered linked list.

5.7 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Preemptive Scheduling Preemptive Scheduling: 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 Scheduling under 1 and 4 is non-preemptive (/cooperative).  Under non-preemptive 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 Scheduling under 2 and 3 is preemptive

5.8 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Dispatcher Dispatcher : is the module gives control of the CPU to the process selected by the short-term scheduler. The dispatcher should be as fast as possible, since it is invoked during every process switch. Dispatch latency – time it takes for the dispatcher to stop one process and start another running

5.9 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Scheduling Criteria CPU utilization – keep the CPU as busy as possible (represented as percentage) Throughput – # of processes that complete their execution per time unit (e.g. 10 processes /sec) Turnaround time – amount of time to execute a particular process Turnaround time is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the CPU, and doing I/O. Turnaround time is generally limited by the speed of the output device. Waiting time – amount of time a process has been waiting in the ready queue Waiting time is the sum of the periods spent waiting in the ready queue. Response time – amount of time it takes from when a request was submitted until the first response is produced (for time-sharing environment) It is the time it takes to start responding, not the time it takes to output the response.

5.10 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Scheduling Algorithm Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min response time

5.11 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition

5.12 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Scheduling Algorithms First-Come, First-Served Scheduling Shortest-Job-First Scheduling Priority Scheduling Round-Robin Scheduling

5.13 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition First-Come, First-Served (FCFS) Scheduling The simplest CPU-scheduling algorithm Basic methodology: The process that requests the CPU first is allocated the CPU first. The implementation of the FCFS: Using a FIFO queue:  When a process enters the ready queue, its PCB is linked onto the tail of the queue. When the CPU is free, it is allocated to the process at the head of the queue. The running process is then removed from the queue. FCFS algorithm is non-preemptive Gantt chart: is a bar chart that illustrates a particular schedule, including the start and finish times of each of the processes.

5.14 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition First-Come, First-Served (FCFS) Scheduling Example(1): Consider the following set of processes that arrive at time 0,with the length of the CPU burst given in milliseconds ProcessBurst Time(ms) P 1 24 P 2 3 P 3 3 Suppose that the processes arrive in the order: P 1, P 2, P 3 The Gantt Chart for the schedule is: Waiting time for P 1 = 0; P 2 = 24; P 3 = 27 Average waiting time: ( )/3 = 17 P1P1 P2P2 P3P

5.15 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition FCFS Scheduling (Cont.) Example(2): Consider the same previous set of processes arrive at time 0,with the length of the CPU burst in milliseconds ProcessBurst Time(ms) P 1 24 P 2 3 P 3 3 Suppose that the processes arrive in the order: P2, P3, P1 The Gantt chart for the schedule is: Waiting time for P 1 = 6; P 2 = 0 ; P 3 = 3 Average waiting time: ( )/3 = 3 >>>>Much better than example (1) Convoy effect >>> short processes wait for the one big process to get off the CPU. This effect results in lower CPU and device utilization than might be possible if the shorter processes were allowed to go first. P1P1 P3P3 P2P

5.16 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition FCFS Scheduling (Cont.) FCFS Pros. (++): Simplest algorithm FCFS Cons. (--): The average waiting time is generally not minimal and affected by processes’ order. Lower CPU and device utilization because of convoy effect Not suitable for time-shared systems

Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition End of Chapter 5