Scheduling in Interactive Systems

Slides:



Advertisements
Similar presentations
Scheduling Introduction to Scheduling
Advertisements

Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
CSC 322 Operating Systems Concepts Lecture - 11: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
CS 149: Operating Systems February 3 Class Meeting
OS, , Part II CPU Scheduling Department of Computer Engineering, PSUWannarat Suntiamorntut.
CPU Scheduling CPU Scheduler Performance metrics for CPU scheduling
WELCOME TO THETOPPERSWAY.COM
Chapter 2 Processes and Threads Scheduling Classical Problems.
More Scheduling cs550 Operating Systems David Monismith.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Round Robin Scheduling A preemptive scheduling designed for Time Sharing Systems The Ready Queue is treated as a circular queue A small execution.
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.
1 Scheduling The part of the OS that makes the choice of which process to run next is called the scheduler and the algorithm it uses is called the 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
Operating Systems Scheduling. Bursts of CPU usage alternate with periods of waiting for I/O. (a) A CPU-bound process. (b) An I/O-bound process. Scheduling.
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
CSC 322 Operating Systems Concepts Lecture - 10: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
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.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Process Scheduling. Scheduling Strategies Scheduling strategies can broadly fall into two categories  Co-operative scheduling is where the currently.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
Lecture 5 Scheduling. Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.
INTRO TO PROCESS SCHEDULING Module 2.4 COP4600 – Operating Systems Richard Newman.
Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Chapter 6: CPU Scheduling
Dan C. Marinescu Office: HEC 439 B. Office hours: M, Wd 3 – 4:30 PM.
Interrupts and signals
Chapter 5a: CPU Scheduling
Networks and Operating Systems: Exercise Session 2
Chapter 2 Scheduling.
Scheduling (Priority Based)
CPU Scheduling.
Chapter 6: CPU Scheduling
Lecture 23: Process Scheduling for Interactive Systems
MODERN OPERATING SYSTEMS Third Edition ANDREW S
ICS 143 Principles of Operating Systems
CS 143A - Principles of Operating Systems
Batch Scheduling Algorithms
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Andy Wang Operating Systems COP 4610 / CGS 5765
Operating Systems Lecture 15.
Operating System Concepts
Module 2.1 COP4600 – Operating Systems Richard Newman
3: CPU Scheduling Basic Concepts Scheduling Criteria
Scheduling Adapted from:
Chapter5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU SCHEDULING.
Outline Scheduling algorithms Multi-processor scheduling
Process Scheduling Decide which process should run and for how long
Chapter 5: CPU Scheduling
Lecture 2 Part 3 CPU Scheduling
Processor Scheduling Hank Levy 1.
Uniprocessor scheduling
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
Scheduling 21 May 2019.
Chapter 6: CPU Scheduling
Don Porter Portions courtesy Emmett Witchel
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Presentation transcript:

Scheduling in Interactive Systems Module 2.6 COP4600 – Operating Systems Richard Newman

SCHEDULING IN INTERACTIVE SYSTEMS Round-Robin Scheduling Priority Scheduling Multiple Queues Shortest Process Next CTSS Guaranteed Scheduling Lottery Scheduling Fair-Share Scheduling Tanenbaum & Bos, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. 2

ROUND-ROBIN SCHEDULING Figure 2-42. Round-robin scheduling. (a) The list of runnable processes. (b) The list of runnable processes after B uses up its quantum. For our problems in scheduling, if process C arrives at the same time that process D uses up its quantum, C will be added to the ready queue before D is added to it. Tanenbaum & Bos, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. 3

ROUND-ROBIN SCHEDULING Process Name: Arrival Time (AT): CPU Burst Length (CT): A 8 B 2 5 C 3 1 D 5 2 E 7 2 Arrivals-> A B C D E Quantum = 1: A A B A C B A D B E A D B E A B A A A C B A D B E A D B E A B A B A D B E A D B E A B A D B E A Turnaround times: A:18-0, B:16-2, C:5-3, D:12-5, E: 14-7 Average TT = (18+14+2+7+7)/5 = 48/5 = 9.6 Turnaround times: A:18-0, B:16-2, C:7-3, D:11-5, E: 15-7 Average TT = (18+14+4+6+8)/5 = 50/5 = 10 Quantum = 2: A A B B A A C B B D D A A E E B A A A A C C B D D A A E E B B A C B B D A A E E B B A A D A E E B B 4

Figure 2-43. A scheduling algorithm with four priority classes. (PREEMPTIVE) PRIORITY SCHEDULING Figure 2-43. A scheduling algorithm with four priority classes. Run a process at priority i+1 over any process at priority i Run processes at priority i in round robin (or whatever) order Preempt process if higher priority process arrives Tanenbaum & Bos, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. 5

PRIORITY SCHEDULING Priority is usually preemptive Process Name: Priority: Arrival Time (AT): CPU Burst Length (CT): A 4 8 B 2 5 C 3 1 D 1 5 2 E 5 7 2 Priority Schedule: A A B B B D D B B C A A A A A A E E Turnaround times: A:16-0, B:9-2, C:10-3, D:7-5, E: 18-7 Average TT = (16+7+7+2+11)/5 = 43/5 = 8.6 Priority is usually preemptive Scheduler is run whenever a process arrives Scheduler runs whenever a process unblocks Priority is most general policy It can model any other policy by priority definition 6

CTSS SCHEDULING CTSS used by Multics OS – try to approximate SRTF Multi-level feedback queue – Enter at queue 0, drop to next queue if TRO Queue i gets 2i for time quantum, i = 0, 1, 2, ... Process Name: Arrival Time (AT): CPU Burst Length (CT): A 8 B 2 5 C 3 1 D 5 2 E 7 2 CTSS: A A B C A D B E B D E AAAA BB A A - B C - D - E - - - - . . . - . - - AA A ABB = BB BBDD BDD BDDEE DDEE EE - . . . - . - - - - - - A4 = = = A4B4 = = . . . B4 . - - - - - - - - - - - - - . . . A8 . = Q0 Q1 Q2 Q3 Turnaround times: A:18-0, B:17-2, C:4-3, D:10-5, E: 11-7 Average TT = (18+15+1+5+4)/5 = 43/5 = 8.6 7

SHORTEST PROCESS NEXT Same as SRTF Main problem: how to know how much time remains? Practically estimate time per CPU burst: Based on observed behavior Count recent behavior more Smooth by “aging” E0 = initial guess, Ti = ith observed time ith estimate Ei = aEi-1 + (1-a)Ti Especially easy to compute if a = ½ Add new time to current estimate and shift right one bit 8

PROPORTIONATE SCHEDULING Guaranteed Scheduling Use actual vs. guarantee to prioritize E.g., fair share fraction of CPU Lottery Scheduling Grant each process some number of tickets Periodically pick a ticket at random Odds of winning a quantum proportional to number of tickets held Fair-Share Scheduling Allocate fraction of CPU to user, not process Can use lottery approach Can prioritize users by number of tickets 9

SCHEDULING IN MINIX Idle process Low User processes Priority Servers Drivers High Kernel tasks Figure 2-43. The scheduler maintains sixteen queues, one per priority level. Shown here is the initial queuing process as MINIX 3 starts up. Tanenbaum & Bos, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. 10

RESTART Figure 2-41. Restart is the common point reached after system startup, interrupts, or system calls. The most deserving process (which may be and often is a different process from the last one interrupted) runs next. Not shown in this diagram are interrupts that occur while the kernel itself is running. Tanenbaum & Bos, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. 11

SUMMARY Round-Robin Priority Multiple Queues CTSS Shortest Process Next Estimating Compute Burst Times Proportionate Scheduling Scheduling in Minix3 12