# Real-Time Scheduling 1 / 39

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Real-Time Scheduling 1 / 39 Multiple Real-Time Processes A runs every 30 msec; each time it needs 10 msec of CPU time B runs 25 times/sec for 15 msec C runs 20 times/sec for 5 msec For our equation, A uses 10/30 of the CPU, B uses 15/40, and C uses 5/50; that s about 81% 2 / 39 1

2 Diagram A1 A2 A3 A B1 B2 B3 C1 C A1 must finish before A2 starts, B1 before B2,... 3 / 39 2

3 Other Issues Some real-time systems permit preemption; some do not Desirability depends on system type (text s discussion is for multimedia system, which are usually preemptible May have aperiodic processes in the mix Static or dynamic scheduling 4 / 39 Rate Monotonic Scheduling A static scheduling algorithm by Lieu and Layland (1973) Conditions: 1. Each periodic process completes within its slot 2. No interprocess dependencies 3. Each process needs the same amount of CPU each time 4. Non-periodic processes have no deadlines 5. Preemption happens instantly with no overhead Yes, this is an oversimplified model... 5 / 39 3

4 Algorithm Assign a process priority equal to its frequency: A = 33, B = 25, C = 20 Always run the highest-priority runnable process Thus, A can preempt B or C; B can preempt C Proved optimal among class of static algorithms 6 / 39 4

5 RMS A1 A2 A3 A4 B1 B2 B3 C1 C2 C3 RMS A1 B1 C1 A2 B2 C2 A3 B3 A4 B3C Note that B3 is preempted to let A4 run 7 / 39 5

6 Earliest Deadline First More general model Supports aperiodic events, non-identical CPU bursts Dynamic priority assignment When a process starts, it announces its deadline Priorities are assigned in order of deadline Initially, A goes first, because it has to finish by T = 30; B s deadline is T = 40 and C s is T = 50 8 / 39 6

7 EDF A1 A2 A3 A4 B1 B2 B3 C1 C2 C3 EDF A1 B1 C1 A2 B2 C2 A3 B3 A4 C At T = 80, it gives B priority 9 / 39 7

8 RMS Doesn t Always Work Suppose that A needs 15 msec each time Our formula says we re ok: (15/ /40 + 5/50) = 97.5% But it fails A1 runs from T = 0 to T = 15; B1 runs from T = 15 to T = 30 At that point, A2 is ready, and has a higher priority than C1; B2 follows it There s no time for C1 before C2 has to start 10 / 39 8

9 RMS Failure A1 A2 A3 A4 B1 B2 B3 C1 C2 C3 RMS A1 B1 A2 B2? C1 can t run before C2 has to start 11 / 39 9

10 Why Did it Fail? RMS is only guaranteed to work if m i=1 C i P i m(2 1/m 1) As m, utilization approaches ln 2 = For m = 3, it can fail (though won t always) at 78% Maximum allowed utilization goes down as m increases EDF will succeed for this example The CPU idle period 2.5% will occur every 200 msec 12 / 39 10

11 EDF Succeeds A1 A2 A3 A4 B1 B2 B3 C1 C2 C3 RMS A1 B1 C1 A2 B2 A3 C2 B3 A4 C Note that C1 runs before A2 13 / 39 11

12 Gantt Charts The diagrams I ve been using are called Gantt Charts Useful tool for modeling process scheduling Especially useful with an automated tool 14 / 39 Other Issues 15 / 39 Scheduling Threads With user-level threads, there is no interaction with the scheduler A kernel-level thread implementation relies on the system s scheduler It s often beneficial to schedule several threads from the same process consecutively avoid changes to the memory map Similar logic says keep threads from the same process on a single CPU, if feasible Application-level thread scheduler can handle priorities more easily, though kernel-level priorities aren t hard to set 16 / 39 12

13 Scheduling and Multiprocessor Systems What processes run on which processor? Does it matter? What are the implications? 17 / 39 Asymmetric Multiprocessing All kernel functions are handled by the master CPU The only thing the other CPUs do in the kernel is pull processes off the run queue and do context switches Simplifies OS design locking is much simpler Common first step in OS conversion for multiprocessor use 18 / 39 13

14 Symmetric Multiprocessing Each processor can do anything Possible to have more than one CPU in the kernel simultaneously Need fine-grained locking; single big lock is almost the same as asymmetric MP Locking is a very important issue for multiprocessors; we ll discuss this more on Wednesday 19 / 39 Processor Affinity Sometimes, it s better (or necessary) for a given process to execute on a specific CPU Example cited earlier: memory map (and cache) I/O issues sometimes a specific I/O devices is on a local bus 20 / 39 14

15 How Do We Measure CPU Time? Early clocks were low resolution Unix classic: 60 Hz Too coarse to measure a fraction of a quantum Besides, the clock was an I/O device, hence slow to access 21 / 39 Statistical Time At each clock tick, add 1 to the current process CPU counter Actually, two counters, one for user mode and one for kernel mode Not accurate over short periods: A process may run for too short a time and not get charged A process may start its quantum right before the timer tick and be charged too much Statistically, though, it s good enough 22 / 39 15

16 I/O and Memory CPU time isn t the only scarce resource Especially today, total system performance is limited by I/O bandwidth and memory availability Must read programs in from disk Must have memory for them That may mean paging out another process, which puts more load on the disk The scheduler should interact with the I/O subsystem and the memory subsystem 23 / 39 Different Schedulers 24 / 39 Scheduler Algorithms Modern systems may have many processes running At this instant, for example, cluster is running 525 processes Even on modern CPUs, we don t want scheduling algorithms that iterate over all processes Linux uses a O(1) scheduler scheduling decisions take constant time, regardless of the number of processes 25 / 39 16

17 Policy versus Mechanism Put some basic mechanism (or mechanisms) in the kernel Permit user processes to set parameters that control scheduling Simplest example: nice command Solaris permits much more control: three classes of scheduler, and parameters within that class 26 / 39 Solaris Scheduler Scheduler classes: real-time, time-sharing, interactive Parameters: Real-Time priority, quantum Kernel threads (System only) Timesharing priority, priority limit Interactive priority, priority limit Newer versions of Solaris have fair-share scheduling and fixed-priority scheduling 27 / 39 17

18 Solaris Priorities Priority Quantum New Priority After Sleep Higher priority processes get shorter quanta. Process get a lower priority when they use up their quantum, and higher priority after blocking for I/O. 28 / 39 Linux Scheduler Both real-time and priority Real-time scheduling can be round-robin or FCFS Dynamic timeslice (quantum) computation Kernel preemption possible if no locks are held 29 / 39 18

19 Windows XP Real-time and priority scheduling Priority classes: Real-time, High, Above Normal, Normal, Below Normal, Idle Relative priority within class: Time-critical, Highest, Above Normal, Normal, Below Normal, Idle Effective priority calculated from this matrix Priority lowered on quantum expiration Extra priority boost for process associated with current window Unix can t easily do that the window manager knows nothing of processes 30 / 39 Evaluating Scheduler Algorithms 31 / 39 Algorithm Evaluation First question: what criteria do you want to optimize for? Possibilities include CPU utilization, responsiveness, real-time scheduling, etc. Several ways to do the evaluation 32 / 39 19

20 Deterministic Modeling Start with a specific workload, i.e., of process CPU demands and arrival times Model them with Gantt charts, as we ve seen Evaluate according to desired metric Simple and fast and only useful for loads that look a lot like what you model 33 / 39 Queueing Theory Start with probability distributions of CPU requests, arrival times, etc. Common assumption: arrivals are distributed according to a Poisson distribution Sample (and simple) result: Let n be the average queue length, W the average queue wait time, and λ the mean interarrival time (regardless of distribution). Then n = λ W 34 / 39 20

21 Simulation Build a simulator of the scheduling algorithm Feed in simulated inputs and see what happens Simulations can be fed by probability distributions or by trace data from real systems Such trace data is an excellent way to compare two different simulators 35 / 39 Metacomment Trace data is always useful Instruction traces, network packet traces, CPU load traces, etc. Some such datasets become the way to evaluate new schemes 36 / 39 21

22 Build It and Try It Build a real system and see what happens But what s the load? Real users? If you re lucky, you have trace data to feed in (and a system amenable to such replays) 37 / 39 Limits of Evaluation Load changes Sometimes, load changes because of scheduler changes Example: if a process gets the CPU more quickly after a disk I/O request, it may be able to issue the next requiest within the rotational delay of the disk Conclusion: we need flexible scheduling algorithms that can be tuned at each site 38 / 39 22

23 Summary Scheduling is a complex matter The criteria and algorithms have changed somewhat, but the problem remains Any time you click on something and it doesn t respond immediately, there s a scheduler problem 39 / 39 23

### COS 318: Operating Systems. CPU Scheduling. (http://www.cs.princeton.edu/courses/cos318/)

COS 318: Operating Systems CPU Scheduling (http://www.cs.princeton.edu/courses/cos318/) Today s Topics! CPU scheduling! CPU Scheduling algorithms 2 When to Schedule?! Process/thread creation! Process/thread

### Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

SFWR ENG 3BB4 Software Design 3 Concurrent System Design 2 SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.8 10 CPU Scheduling Chapter 11 CPU Scheduling Policies Deciding which process to run

### Chapter 6 CPU Scheduling. Contents

Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual

### CPU Scheduling Outline

CPU Scheduling Outline What is scheduling in the OS? What are common scheduling criteria? How to evaluate scheduling algorithms? What are common scheduling algorithms? How is thread scheduling different

### Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Scheduling Yücel Saygın These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum 1 Scheduling Introduction to Scheduling (1) Bursts of CPU usage alternate with periods

### CPU scheduling. Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times. CPU Scheduler

CPU scheduling Alternating Sequence of CPU And I/O Bursts Maximum CPU utilization is obtained by multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

### Chapter 5: CPU Scheduling. Operating System Concepts 7 th Edition, Jan 14, 2005

Chapter 5: CPU Scheduling Operating System Concepts 7 th Edition, Jan 14, 2005 Silberschatz, Galvin and Gagne 2005 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

### COS 318: Operating Systems. CPU Scheduling. Kai Li and Andy Bavier Computer Science Department Princeton University

COS 318: Operating Systems CPU Scheduling Kai Li and Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall13/cos318/ Quiz 1 u Avg score: 10.7 u Suggested

### ICS 143 - Principles of Operating Systems

ICS 143 - Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Note that some slides are adapted from course text slides 2008 Silberschatz. Some

Scheduling Reading: Silberschatz chapter 6 Additional Reading: Stallings chapter 9 EEL 358 1 Outline Introduction Types of Scheduling Scheduling Criteria FCFS Scheduling Shortest-Job-First Scheduling Priority

### Chapter 5 Process Scheduling

Chapter 5 Process Scheduling CPU Scheduling Objective: Basic Scheduling Concepts CPU Scheduling Algorithms Why Multiprogramming? Maximize CPU/Resources Utilization (Based on Some Criteria) CPU Scheduling

### Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Scheduling Scheduling Scheduling levels Long-term scheduling. Selects which jobs shall be allowed to enter the system. Only used in batch systems. Medium-term scheduling. Performs swapin-swapout operations

### 2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

Import Settings: Base Settings: Brownstone Default Highest Answer Letter: D Multiple Keywords in Same Paragraph: No Chapter: Chapter 5 Multiple Choice 1. Which of the following is true of cooperative scheduling?

### Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition

Chapter 5: CPU Scheduling Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

### Chapter 6: CPU Scheduling

1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 2 Basic Concepts Maximum CPU utilization

### CPU Scheduling Yi Shi Fall 2015 Xi an Jiaotong University

CPU Scheduling Yi Shi Fall 2015 Xi an Jiaotong University Goals for Today CPU Schedulers Scheduling Algorithms Algorithm Evaluation Metrics Algorithm details Thread Scheduling Multiple-Processor Scheduling

### Scheduling for uniprocessor systems Introduction

Politecnico di Milano Introduction Lecturer: William Fornaciari Politecnico di Milano william.fornaciari@elet.polimi.it Home.dei.polimi.it/fornacia SUMMARY Basic Concepts Scheduling Criteria Scheduling

### Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Linux Example

### Objectives. 5.1 Basic Concepts. Scheduling Criteria. Multiple-Processor Scheduling. Algorithm Evaluation. Maximum CPU.

Chapter 5: Process Scheduling Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms To discuss evaluation criteria for selecting the CPU-scheduling algorithm for a particular

### Chapter 6: CPU Scheduling. Basic Concepts

1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

### Chapter 5: CPU Scheduling!

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

### Chapter 5 CPU Scheduling

Chapter 5 CPU Scheduling CPU Scheduling 1 Outline! Basic Concepts.! Scheduling Criteria.! Scheduling Algorithms.! Multiple-Processor Scheduling.! Thread Scheduling.! Operating Systems Examples.! Algorithm

### Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms Chapter 5: Process Scheduling To discuss evaluation criteria for selecting the CPUscheduling algorithm for a particular

### III. Process Scheduling

Intended Schedule III. Process Scheduling Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment

### III. Process Scheduling

III. Process Scheduling 1 Intended Schedule Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment

### spends most its time performing I/O How is thread scheduling different from process scheduling? What are the issues in multiple-processor scheduling?

CPU Scheduling Outline What is scheduling in the OS? What are common scheduling criteria? How to evaluate scheduling algorithms? What are common scheduling algorithms? How is thread scheduling different

### Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6 Winter Term 2008 / 2009 Jun.-Prof. Dr. André Brinkmann Andre.Brinkmann@uni-paderborn.de Universität Paderborn PC² Agenda Multiprocessor and

### CS 571 Operating Systems. CPU Scheduling. Angelos Stavrou, George Mason University

CS 571 Operating Systems CPU Scheduling Angelos Stavrou, George Mason University CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms First-Come-First-Served Shortest-Job-First, Shortest-remaining-Time-First

### Introduction to process scheduling. Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms

Lecture Overview Introduction to process scheduling Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms First-come, first-serve Shortest-job-first Priority Round-robin

### I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 5: PROCESS SCHEDULING Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor

### CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems Based on original slides by Silberschatz, Galvin and Gagne 1 Basic Concepts CPU I/O Burst Cycle Process execution

### CPU Scheduling. Outline

CPU Scheduling Thomas Plagemann (with slides from Otto J. Anshus, Kai Li, Pål Halvorsen and Andrew S. Tanenbaum) Goals of scheduling Outline Scheduling algorithms: FCFS/FIFO, RR, STCF/SRTCF Priority (CTSS,

### Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

77 16 CPU Scheduling Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5 Until now you have heard about processes and memory. From now on you ll hear about resources, the things operated upon

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d

Comp 204: Computer Systems and Their Implementation Lecture 12: Scheduling Algorithms cont d 1 Today Scheduling continued Multilevel queues Examples Thread scheduling 2 Question A starvation-free job-scheduling

### Agenda. CPU Scheduling. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times. Alternating Sequence of CPU And I/O Bursts

TDDB3: Concurrent programming and operating systems [SGG7] Chapter 5 Agenda CPU Scheduling Introduce CPU scheduling Describe various CPU scheduling algorithms Discuss evaluation criteria of CPU scheduling

### Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling 1.1 Maximum CPU utilization obtained with multiprogramming CPU I/O Burst

### CHAPTER 5: PROCESS SCHEDULING (B) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CHAPTER 5: PROCESS SCHEDULING (B) By I-Chen Lin Textbook: Operating System Concepts 9th Ed. Multiple-Processor Scheduling CPU scheduling more complex when multiple CPUs are available Homogeneous processors

### Process Scheduling CS 241. February 24, 2012. Copyright University of Illinois CS 241 Staff

Process Scheduling CS 241 February 24, 2012 Copyright University of Illinois CS 241 Staff 1 Announcements Mid-semester feedback survey (linked off web page) MP4 due Friday (not Tuesday) Midterm Next Tuesday,

### CSC 539: Operating Systems Structure and Design. Spring 2006

CSC 539: Operating Systems Structure and Design Spring 2006 CPU scheduling historical perspective CPU-I/O bursts preemptive vs. nonpreemptive scheduling scheduling criteria scheduling algorithms: FCFS,

### Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

Announcements Reading Chapter 5 Chapter 7 (Monday or Wednesday) Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution What are the

CHAPTER 5 CPU scheduling is the basis of multiprogrammed operating systems. By switching the CPU among processes, the operating system can make the computer more productive. In this chapter, we introduce

### Operating Systems Concepts: Chapter 7: Scheduling Strategies

Operating Systems Concepts: Chapter 7: Scheduling Strategies Olav Beckmann Huxley 449 http://www.doc.ic.ac.uk/~ob3 Acknowledgements: There are lots. See end of Chapter 1. Home Page for the course: http://www.doc.ic.ac.uk/~ob3/teaching/operatingsystemsconcepts/

### Operatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings

Operatin g Systems: Internals and Design Principle s Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings Operating Systems: Internals and Design Principles Bear in mind,

### Outline. Chapter 5: Process Scheduling Yean Fu Wen Nov. 24, Basic Concepts Scheduling Criteria Scheduling Algorithms

Chapter 5: Process Scheduling Yean Fu Wen yeanfu@mail.ncyu.edu.tw Nov. 24, 2009 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms FCFS, SJF, Priority, RR, MQ, MFQ Thread Scheduling Multiple

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm Evaluation Objectives To introduce

### CPU scheduling. CPU Scheduling. No.4. CPU burst vs. I/O burst. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University

EECS 3221 Operating System Fundamentals No.4 CPU scheduling Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University CPU Scheduling CPU scheduling is the basis of multiprogramming

### Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

### Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

Road Map Scheduling Dickinson College Computer Science 354 Spring 2010 Past: What an OS is, why we have them, what they do. Base hardware and support for operating systems Process Management Threads Present:

### CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes

Scheduling Objectives CPU SCHEDULING Enforcement of fairness in allocating resources to processes Enforcement of priorities Make best use of available system resources Give preference to processes holding

### CPU Scheduling. Core Definitions

CPU Scheduling General rule keep the CPU busy; an idle CPU is a wasted CPU Major source of CPU idleness: I/O (or waiting for it) Many programs have a characteristic CPU I/O burst cycle alternating phases

### Chapter 5: Process Scheduling. Operating System Concepts with Java 8 th Edition

Chapter 5: Process Scheduling Operating System Concepts with Java 8 th Edition 5.1 Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms

### Operating Systems. III. Scheduling. http://soc.eurecom.fr/os/

Operating Systems Institut Mines-Telecom III. Scheduling Ludovic Apvrille ludovic.apvrille@telecom-paristech.fr Eurecom, office 470 http://soc.eurecom.fr/os/ Outline Basics of Scheduling Definitions Switching

### Chapter 5: CPU Scheduling

COP 4610: Introduction to Operating Systems (Spring 2016) Chapter 5: CPU Scheduling Zhi Wang Florida State University Contents Basic concepts Scheduling criteria Scheduling algorithms Thread scheduling

### Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

Overview of Real-Time Scheduling Embedded Real-Time Software Lecture 3 Lecture Outline Overview of real-time scheduling algorithms Clock-driven Weighted round-robin Priority-driven Dynamic vs. static Deadline

### Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) CPU Scheduling: Overview. Scheduling: Components

Outline V22.0202-001 Computer Systems Organization II (Honors) (Introductory Operating Systems) Lecture 10 CPU Scheduling February 23, 2005 Announcements Lab 3 due on March 2 nd, Demos on March 2 nd and

### Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

### CPU Scheduling. Date. 2/2/2004 Operating Systems 1

CPU Scheduling Date 2/2/2004 Operating Systems 1 Basic concepts Maximize CPU utilization with multi programming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

### CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts

CS307 Basic Concepts Maximize CPU utilization obtained with multiprogramming CPU Scheduling CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution

### CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms!

CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! First-Come-First-Served! Shortest-Job-First, Shortest-remaining-Time-First! Priority Scheduling! Round Robin! Multi-level Queue!

### Chapter 5: Process Scheduling

Chapter 5: Process Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling

### CPU Scheduling: Basic Concepts

CPU Scheduling: Basic Concepts Idea: Maximum CPU utilization obtained with multiprogramming" CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait" Dispatcher grants CPU

### CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

CPU SCHEDULING CPU SCHEDULING (CONT D) Aims to assign processes to be executed by the CPU in a way that meets system objectives such as response time, throughput, and processor efficiency Broken down into

### Lecture 5 Process Scheduling (chapter 5)

Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 5 Process Scheduling (chapter 5) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The slides

### Announcements Project #2. Basic Concepts

Announcements Project #2 Is due at 6:00 PM on Friday Program #3 Posted tomorrow (implements scheduler) Reading Chapter 6 Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU

### Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

### Module 6: CPU Scheduling. Basic Concepts. Alternating Sequence of CPU And I/O Bursts

Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Applied Operating System Concepts 6.1 Basic Concepts

### W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems Instructor: Junfeng Yang Outline Introduction to scheduling Scheduling algorithms 1 Direction within course Until now: interrupts, processes, threads, synchronization Mostly mechanisms

### Computer Science 322 Operating Systems Mount Holyoke College Spring Topic Notes: CPU Scheduling

Computer Science 322 Operating Systems Mount Holyoke College Spring 2008 Topic Notes: CPU Scheduling The CPU is the first of several scarce resources that we will consider. A primary function of an operating

### Linux Scheduler. Linux Scheduler

or or Affinity Basic Interactive es 1 / 40 Reality... or or Affinity Basic Interactive es The Linux scheduler tries to be very efficient To do that, it uses some complex data structures Some of what it

### Chapter 5: Process Scheduling

Chapter 5: Process Scheduling Chapter 5: Process Scheduling 5.1 Basic Concepts 5.2 Scheduling Criteria 5.3 Scheduling Algorithms 5.3.1 First-Come, First-Served Scheduling 5.3.2 Shortest-Job-First Scheduling

### CS307 Operating Systems CPU Scheduling

CS307 CPU Scheduling Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2016 Basic Concepts Maximize CPU utilization obtained with multiprogramming CPU I/O Burst

### Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 1 Basic Concepts Maximum CPU utilization obtained

### Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

### Silberschatz and Galvin

Silberschatz and Galvin Chapter 5 CPU Scheduling CPSC 410--Richard Furuta 01/19/99 1 Topics covered Basic concepts/scheduling criteria Non-preemptive and Preemptive scheduling Scheduling algorithms Algorithm

### EE8205: Embedded Computer System Multitasking and Real-time Operating System -- Problem Set 2014 Solutions

EE8205: Embedded Computer System Multitasking and Real-time Operating System -- Problem Set 2014 Solutions Out: November 26, 2014 P. 1: What is the difference between turnaround time and response time.

### Predictable response times in event-driven real-time systems

Predictable response times in event-driven real-time systems Automotive 2006 - Security and Reliability in Automotive Systems Stuttgart, October 2006. Presented by: Michael González Harbour mgh@unican.es

### Basic Concepts. Chapter 6: CPU Scheduling. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Chapter 6: CPU Scheduling Basic Concepts Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Maximum CPU utilization obtained

### Processor Scheduling. Queues Recall OS maintains various queues

Processor Scheduling Chapters 9 and 10 of [OS4e], Chapter 6 of [OSC]: Queues Scheduling Criteria Cooperative versus Preemptive Scheduling Scheduling Algorithms Multi-level Queues Multiprocessor and Real-Time

### Process boundness. Process scheduling. Alternating Sequence of CPU and I/O Bursts. Histogram of CPU-burst Times

Process scheduling slide 1 Process boundness slide 2 See Silberschatz Chapter 5 Processes can be described as either: I/O-bound process - spends more time doing I/O than computations, many short bursts

### CPU Scheduling. CSC 256/456 - Operating Systems Fall 2014. TA: Mohammad Hedayati

CPU Scheduling CSC 256/456 - Operating Systems Fall 2014 TA: Mohammad Hedayati Agenda Scheduling Policy Criteria Scheduling Policy Options (on Uniprocessor) Multiprocessor scheduling considerations CPU

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts! Scheduling Criteria! Scheduling Algorithms! Thread Scheduling! Multiple-Processor Scheduling! Operating Systems Examples! Algorithm Evaluation!

### COSC243 Part 2: Operating Systems

COSC243 Part 2: Operating Systems Lecture 17: CPU Scheduling Zhiyi Huang Dept. of Computer Science, University of Otago Zhiyi Huang (Otago) COSC243 Lecture 17 1 / 30 Overview Last lecture: Cooperating

### CPU scheduling. Kevin Marquet. September INSA Lyon / IF CITI Lab/INRIA Socrate

CPU scheduling Kevin Marquet INSA Lyon / IF CITI Lab/INRIA Socrate September 2014 CPU-I/O burst CPU burst : process requires CPU execution I/O burst : process waits for I/O completion (CPU-IO burst) (burst

### 4003-440/4003-713 Operating Systems I. Process Scheduling. Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu)

4003-440/4003-713 Operating Systems I Process Scheduling Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu) Review: Scheduling Policy Ideally, a scheduling policy should: Be: fair, predictable

### CPU Scheduling. CPU Scheduling. Scheduling criteria. Scheduling criteria. FCFS continued. Example: FCFS Scheduling

CPU Scheduling CPU Scheduling new admitted interrupt exit terminated ready running I/O or event completion scheduler dispatch waiting I/O or event wait The scheduling problem: - Have K jobs ready to run

### Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Oct-03 1 Basic Concepts Maximum CPU utilization

### Introduction to Operating Systems. CS 499: Special Topics in Cyber Security S. Sean Monemi

Introduction to Operating Systems CS 499: Special Topics in Cyber Security S. Sean Monemi 1 Overview Operating Systems Definition Processes and Threads Program Control Blocks Process Scheduling and Interrupts

### Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

### CS 4410 Operating Systems. CPU Scheduling. Summer 2011 Cornell University

CS 4410 Operating Systems CPU Scheduling Summer 2011 Cornell University Today How does CPU manage the execution of simultaneously ready processes? Example Multitasking - Scheduling Scheduling Metrics Scheduling

### CPU Scheduling. User/Kernel Threads. Mixed User/Kernel Threads. Solaris/Linux Threads. CS 256/456 Dept. of Computer Science, University of Rochester

CPU Scheduling CS 256/456 Dept. of Computer Science, University of Rochester User/Kernel Threads User threads Thread data structure is in user-mode memory scheduling/switching done at user mode Kernel

### Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Scheduling & Resource Utilization

Road Map Scheduling Dickinson College Computer Science 354 Spring 2012 Past: What an OS is, why we have them, what they do. Base hardware and support for operating systems Process Management Threads Present:

### Chapter 5: CPU Scheduling. Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### COS 318: Operating Systems. CPU Scheduling. Prof. Margaret Martonosi Computer Science Department Princeton University

COS 318: Operating Systems CPU Scheduling Prof. Margaret Martonosi Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall11/cos318/ Steve Jobs 1955-2011 Your

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### ECE3055 Computer Architecture and Operating Systems

ECE3055 Computer Architecture and Operating Systems Lecture: CPU Scheduling Prof. Hsien-Hsin Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology H.-H. S. Lee 1 Overview