More Scheduling cs550 Operating Systems David Monismith.

Slides:



Advertisements
Similar presentations
Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
Advertisements

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 17 Scheduling III.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Operating Systems CPU Scheduling. Agenda for Today What is Scheduler and its types Short-term scheduler Dispatcher Reasons for invoking scheduler Optimization.
CPU Scheduling Algorithms
WELCOME TO THETOPPERSWAY.COM
Chapter 3: CPU Scheduling
Operating Systems 1 K. Salah Module 2.1: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance Evaluation.
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.
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
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
CS3530 OPERATING SYSTEMS Summer 2014 Processor Scheduling Chapter 5.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Chapter 6 CPU SCHEDULING.
Round Robin Scheduling A preemptive scheduling designed for Time Sharing Systems The Ready Queue is treated as a circular queue A small execution.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Scheduling Policies and File Systems Operating Systems CS 550.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
Operating Systems 1 K. Salah Module 2.2: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance Evaluation.
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.
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.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
CS333 Intro to Operating Systems Jonathan Walpole.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
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.
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.
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.
OPERATING SYSTEMS CS 3502 Fall 2017
CPU SCHEDULING.
CPU Scheduling.
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Operating System Concepts
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
Chapter 6: CPU Scheduling
Outline Scheduling algorithms Multi-processor scheduling
Chapter 5: CPU Scheduling
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
CPU SCHEDULING CPU SCHEDULING.
Chapter 6: CPU Scheduling
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Presentation transcript:

More Scheduling cs550 Operating Systems David Monismith

Round Robin Scheduling Used in time sharing systems -Processes are allocated to CPU for fixed time interval called a time quantum or time slice -After interval expires, a process that is executing or receiving CPU service is interrupted by the system -A time slice is often shorter than the average CPU burst of processes -Once the time slice expires, the scheduler performs a context switch to the next process selected from the ready queue -After a process completes its time slice, it is interrupted and cycled back to the ready queue until it completes its CPU burst or encounters a resource request (e.g. I/O) that cannot be fulfilled

RR attempts to allocate the CPU in a uniform manner to all processes in the ready queue for fixed, short intervals. All processes get equal chance to receive CPU service for short periods of time (time slices) This works well for interactive computing The time slice is a system parameter  This should typically be less than the CPU burst time and more than context switch time If the slice is too long or too short, performance will degrade Round Robin Scheduling (Cont’d)

Round Robin Scheduling(Contd..) Note that for the previous slide set NTAT = turnaround time/burst time It is possible to implement round robin as single or multi-class In multi-class scheduling, we give processes different priorities and select processes to run from the ready queue based upon priority.

Example Assume 5 processes and a time slice of 40 units CPU Burst Time P1 135 P2 102 P3 56 P4 148 P5 125

RR Gantt Chart

Shortest Remaining Time  Preemptive version of SPN  New processes interrupt the current process if the new process has a shorter remaining service period (CPU burst time)

Shortest Remaining Time First (SRTF) Preemptive version of SJF New processes with shorter remaining times than processes using the CPU interrupt the currently executing process A context switch occurs and the new process is started immediately When the prices completes CPU service, the next process selected from the ready queue is the one with the shortest remaining service period

Shortest Remaining Time First (SRTF) Continued Scheduler selects the process with the shortest burst time This type of scheduling is multi-class because preference is given to short bursts Internal priority is used for each group or class of processes Scheduler gives preference to processes with shorter bursts Not fair when compared to FCFS and RR Starvation may occur

Example Arrival Time Burst Time Order P th P nd P st P th P rd <--stop with 83 ms left (5th) P th Gantt Chart:

Dynamic Scheduling Policies Dynamic Priority Scheduling Processes often alternate between CPU and I/O bursts Programs often need I/O then CPU and repeat We could give such processes higher priority to keep I/O busy without using too much CPU time It can be hard decide which processes to give high priority Note that Fixed Priority Scheduling will not work

Dynamic Scheduling Policies Dynamic priority scheduling adjusts a process's priority as it runs Adjustment based upon what will happen next Need branch prediction! Could approximate or guess (use heuristic) what will happen next

Algorithm could be based on the following heuristic Process that has just completed IO will likely request another Allocate CPU to highest priority process When a process is selected for execution, give it a time slice. If a process requests an IO operation before its time slice expires, raise its priority (assume it will carry out another IO request soon). If the time slice expires, lower its priority (assume process is in a CPU burst) and allocate the CPU to the highest priority process. Dynamic Scheduling Policies (Cont’d)

Longest Job First (LJF) Other scheduling policies(Contd..) Real-time scheduling RT (aka reactive systems) continuously interact with the external environment Behavior defined by timing constraints Want fast response to high priority RT processes Processes have deadline requirements (e.g. must complete service before deadline expires) Could be periodic or sporadic  Periodic starts every p time units  Has computation time requirement c and deadline d  Sporadic spurred by random even and must start and complete before deadline

Two possible policies Rate Monotonic Scheduling Process Priorities assigned statically in reverse order of period length Higher priority for shorter periods Earliest Deadline First Priorities assigned statically or dynamically Processes with earlier deadlines are given higher priorities Other scheduling policies (Cont’d)

Multi-level Queues and Multiple Processors Several classes of processes in multi class systems each with different priority Use priority scheduling that can be either non-preemptive or preemptive Need multi-level queues because each category of process needs its own queue Maybe one needs batch processing while the other needs interactive With multiprocessor system there are many ways to accomplish this