1 Scheduling Algorithms FCFS First-Come, First-Served Round-robin SJF Multilevel Feedback Queues.

Slides:



Advertisements
Similar presentations
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Advertisements

CPU Scheduling Questions answered in this lecture: What is scheduling vs. allocation? What is preemptive vs. non-preemptive scheduling? What are FCFS,
1 Uniprocessor Scheduling Types of scheduling –The aim of processor scheduling is to assign processes to be executed by the processor so as to optimize.
CPU Scheduling CPU Scheduler Performance metrics for CPU scheduling
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Operating Systems Chapter 6
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
Day 25 Uniprocessor scheduling. Algorithm: Selection function Selection function – which process among ready processes to select. w – time spent in system,
CENG 334 – Operating Systems 05- Scheduling
Chapter 3: CPU Scheduling
Operating Systems 1 K. Salah Module 2.1: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance Evaluation.
6/25/2015Page 1 Process Scheduling B.Ramamurthy. 6/25/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (2) Process Management 10/03/2008 Yang Song (Prepared by Yang Song and.
Chapter 5-CPU Scheduling
Job scheduling Queue discipline.
CPU Scheduling Prof. Sirer (dr. Willem de Bruijn) CS 4410 Cornell University.
7/12/2015Page 1 Process Scheduling B.Ramamurthy. 7/12/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
CPU-Scheduling Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. The short term scheduler.
Recall … Process states –scheduler transitions (red) Challenges: –Which process should run? –When should processes be preempted? –When are scheduling decisions.
CPU Scheduling Chapter 6 Chapter 6.
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.
10CSE CPU Scheduling Copyrights Lecture Slides adapted from “ Advanced Operating Systems ”, Lecture Notes by Prof. Prof. Daniel Mosse, University Of Pittsburgh,
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Chapter 6 CPU SCHEDULING.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
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.
Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Process A program in execution. But, What does it mean to be “in execution”?
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Operating Systems 1 K. Salah Module 2.2: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance 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.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
First In First Out SJF is a scheduling policy that selects a waiting process with the smallest execution time to execute next. Shortest Job First Shortest.
CPU Scheduling CS Introduction to Operating Systems.
CPU Scheduling G.Anuradha Reference : Galvin. CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time.
Process Scheduling. Scheduling Strategies Scheduling strategies can broadly fall into two categories  Co-operative scheduling is where the currently.
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
Process Scheduling ( ) CPE Operating Systems
Basic Concepts Maximum CPU utilization obtained with multiprogramming
3. CPU Scheduling. CPU Scheduling Process execution – a cycle of CPU execution and I/O wait – figure Preemptive Non-Preemptive.
Lecture 5 Scheduling. Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.
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.
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.
CPU Scheduling Andy Wang Operating Systems COP 4610 / CGS 5765.
CPU SCHEDULING.
Scheduling (Priority Based)
CPU Scheduling.
Andy Wang Operating Systems COP 4610 / CGS 5765
Process Scheduling Decide which process should run and for how long
Concurrency and Threading: CPU Scheduling
CPU SCHEDULING CPU SCHEDULING.
Don Porter Portions courtesy Emmett Witchel
Presentation transcript:

1 Scheduling Algorithms FCFS First-Come, First-Served Round-robin SJF Multilevel Feedback Queues

2 Round-Robin Scheduling Quantum expires: move to back of ready queue Variants used in most real systems Tradeoffs: length of quantum Large: response time increases Small: throughput decreases quantum → 0 = overhead dominates context switches, cache misses

3 Example: Round-Robin waiting running

4 Example: Round-Robin waiting running

5 Example: Round-Robin waiting running

6 Example: Round-Robin waiting running

7 Example: Round-Robin waiting running

8 Example: Round-Robin waiting running

9 Example: Round-Robin waiting running

10 Example: Round-Robin waiting running

11 Example: Round-Robin waiting running

12 Example: Round-Robin waiting running

13 Example: Round-Robin waiting running + Fair - Long average wait times

14 Round-Robin vs. FCFS Example 1: 5 jobs, 100 seconds each, quantum = 1s ignore context switch time

15 Round-Robin vs. FCFS Example 1: 5 jobs, 100 seconds each, quantum = 1s ignore context switch time

16 Round-Robin vs. FCFS Example 2: 5 jobs: 50, 40, 30, 20, 10 seconds each, quantum = 1s

17 Round-Robin vs. FCFS Example 2: 5 jobs: 50, 40, 30, 20, 10 seconds each, quantum = 1s

18 This Time: Scheduling Algorithms FCFS First-Come, First-Served Round-robin SJF Multilevel Feedback Queues

19 Example: SJF Schedule job with least work until I/O or done

20 Example: SJF Schedule job with least work until I/O or done

21 Example: SJF Schedule job with least work until I/O or done

22 Example: SJF Schedule job with least work until I/O or done

23 Example: SJF Schedule job with least work until I/O or done

24 Example: SJF Schedule job with least work until I/O or done

25 Example: SJF 5 jobs, length 50, 40, 30, 20, 10 seconds, quantum = 1s

26 Example: SJF 5 jobs, length 50, 40, 30, 20, 10 seconds

27 SJF/SRTF: Shortest-Job First Advantages: Provably optimal – minimizes average waiting time Works for preemptive & non-preemptive schedulers Preemptive SJF = SRTF Shortest remaining time first Disadvantages: Impossible to predict CPU time job has left Long-running CPU-bound jobs can starve

28 This Time: Scheduling Algorithms FCFS First-Come, First-Served Round-robin SJF Multilevel Feedback Queues

29 Multilevel Feedback Queues (MLFQ) Use past behavior to predict future, assign job priorities Overcome prediction problem in SJF Assumption: I/O-bound in past, I/O-bound in future Scheduler favors jobs that used least CPU time Adaptive: Change in behavior → change in scheduling decisions

30 MLFQ: Approximating SJF Multiple queues, different priorities Round-robin scheduling at each priority level Run all jobs at highest priority first (till this queue is empty), then next, etc. Can lead to starvation Increase quantum exponentially at lower priorities

31 MLFQ Example

32 MLFQ: Assigning Priorities Job starts in highest priority queue Quantum expires → CPU-bound Drop priority one level Quantum does not expire → I/O-bound Increase priority one level  CPU-bound jobs move down, I/O-bound jobs move up

33 Summary of Scheduling Algorithms FCFS: unfair, average waiting time poor Round robin: fair, average waiting time poor SJF: unfair, minimizes average waiting time requires accurate prediction Multilevel Feedback Queuing: approximates SJF