Lecture 5 Scheduling. Today CPSC 457 - Tyson Kendon 20161 Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.

Slides:



Advertisements
Similar presentations
CPU Scheduling.
Advertisements

Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
 Basic Concepts  Scheduling Criteria  Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Operating Systems Chapter 6
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Algorithms
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.
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
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
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
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
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.
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: 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.
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.
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.
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Processor Scheduling Hank Levy. 22/4/2016 Goals for Multiprogramming In a multiprogramming system, we try to increase utilization and thruput by overlapping.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
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.
CPU Scheduling Algorithms CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
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.
Lecture 6 The Rest of Scheduling Algorithms and The Beginning of Memory Management.
CPU SCHEDULING.
Dan C. Marinescu Office: HEC 439 B. Office hours: M, Wd 3 – 4:30 PM.
CPSC 457 Operating Systems
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 5: CPU Scheduling
Chapter 6: CPU Scheduling
Outline Scheduling algorithms Multi-processor scheduling
Chapter 5: CPU Scheduling
Processor Scheduling Hank Levy 1.
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Presentation transcript:

Lecture 5 Scheduling

Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms

Assignment 1 CPSC Tyson Kendon 20162

Assignment 2 CPSC Tyson Kendon 20163

Concept Overview CPSC Tyson Kendon 20164

Last Time CPSC Tyson Kendon Threads Processes Creation Implementation Termination Information Context Switching Split Execution from Resources Life Span

Scheduling Processes CPSC Tyson Kendon Scheduling Concepts Scheduling Timing Preemptive vs Nonpreemptive Types of Scheduling Algorithms Scheduling Algorithm Goals and Metrics Scheduling Algorithms First Come, First Served Shortest Job First Exponential Average Priority Scheduling Round-Robin Multi-Queue Scheduling And many more!

Scheduling Concepts CPSC Tyson Kendon Deciding when to schedule Defining process behaviour CPU Burst Length Deciding which process should be running Do we interrupt a process once it’s running Preemptive vs Nonpreemptive

Scheduling Goals and Metrics CPSC Tyson Kendon Policy Enforcement Fairness Balance Throughput Turnaround Time CPU Utilization Response Time Wait Time Proportionality Meeting Deadlines Predictability Real Time

Types of Scheduling Algorithm CPSC Tyson Kendon Batch Interactive Real Time

Scheduling Algorithms CPSC Tyson Kendon First Come, First Served Shortest Job First Priority Scheduling Round-Robin Multi-Queue Scheduling Guaranteed Scheduling Lottery Scheduling Fair-Share scheduling

First Come, First Served CPSC Tyson Kendon Algorithm As processes arrive to be scheduled, they are added to the end of the queue. When it’s time to schedule a new process, the scheduler picks the head of the queue.

First Come, First Served CPSC Tyson Kendon Comments Nonpreemptive Bad for an interactive system Turnaround and Wait Times based on the sequence of arrival Easy to program Tends to bunch up I/O bound processes

Shortest Job First CPSC Tyson Kendon Algorithm As processes arrive to be scheduled, they are added to the end of the queue. When it’s time to schedule a new process, the scheduler picks the process with the shortest CPU burst next.

Shortest Job First CPSC Tyson Kendon Problem We don’t know how long each CPU burst is going to be. But we’re good at estimating things:

Exponential Average for CPU Burst Time CPSC Tyson Kendon ♣ n+1 = ♥ t n + (1 - ♥ ) ♣ n Powerpoint on mac… ♣ t n - the actual burst time for the n th burst of the process ♣ n - the predicted burst time for the n th burst of the process ♥ - weight to bias the average more to the last burst or the history

Shortest Job First CPSC Tyson Kendon Comments Preemptive or Nonpreemptive Can lead to starvation Provably optimal (if all jobs arrive at the same time) Slightly harder to program Need to implement burst estimation and track for processes

Priority Scheduling CPSC Tyson Kendon Algorithm Processes are assigned different priorities (somehow) A process is added to the queue for it’s priority The scheduler selects (fcfs, sjf or someotherway) from all of the processes in the highest priority queue

Priority Scheduling CPSC Tyson Kendon Comments Preemptive or Nonpreemptive Can lead to starvation We can use aging to stave off starvation Adheres to system policy Still fairly easy to implement

Round Robin CPSC Tyson Kendon Algorithm Start with FCFS Preempt processes after a fixed amount of CPU time (called the Time Quantum or the Time Slice) If you stopped a process for using all of it’s time, put it on the back of the queue.

Round Robin CPSC Tyson Kendon Comments Preemptive Have to factor in context switch time We can adjust the quantum to alter the behaviour of the system Generally want the quantum to long enough that the majority of processes (I/O bound) finish within it

Where Next? CPSC Tyson Kendon More Scheduling Real World Implementations Memory Management