Lecture 24: Process Scheduling Examples and for Real-time Systems

Slides:



Advertisements
Similar presentations
CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
Advertisements

Real-Time Scheduling CIS700 Insup Lee October 3, 2005 CIS 700.
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
CPU SCHEDULING RONG ZHENG. OVERVIEW Why scheduling? Non-preemptive vs Preemptive policies FCFS, SJF, Round robin, multilevel queues with feedback, guaranteed.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
More Scheduling cs550 Operating Systems David Monismith.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Round Robin Scheduling A preemptive scheduling designed for Time Sharing Systems The Ready Queue is treated as a circular queue A small execution.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
2.5 Scheduling Given a multiprogramming system. Given a multiprogramming system. Many times when more than 1 process is waiting for the CPU (in the ready.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Scheduling Policies and File Systems Operating Systems CS 550.
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs.
2.5 Scheduling. Given a multiprogramming system, there are many times when more than 1 process is waiting for the CPU (in the ready queue). Given a multiprogramming.
CSC 322 Operating Systems Concepts Lecture - 10: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
CS333 Intro to Operating Systems Jonathan Walpole.
Lecture 5 Scheduling. Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.
Real-Time Operating Systems RTOS For Embedded systems.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
Embedded System Scheduling
OPERATING SYSTEMS CS 3502 Fall 2017
Chapter 6: CPU Scheduling (Cont’d)
lecture 5: CPU Scheduling
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Operating Systems Design (CS 423)
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Networks and Operating Systems: Exercise Session 2
EEE 6494 Embedded Systems Design
Chapter 2 Scheduling.
Chapter 8 – Processor Scheduling
Lecture 4 Schedulability and Tasks
CPU scheduling 6. Schedulers, CPU Scheduling 6.1. Schedulers
CPU Scheduling.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Lecture 23: Process Scheduling for Interactive Systems
CS 143A - Principles of Operating Systems
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Lecture 21: Introduction to Process Scheduling
Operating System Concepts
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
Chapter 6: CPU Scheduling
Process Scheduling Decide which process should run and for how long
Lecture 2 Part 3 CPU Scheduling
Process Management Scheduling
Processes and operating systems
Lecture 21: Introduction to Process 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
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
CPU SCHEDULING CPU SCHEDULING.
Scheduling 21 May 2019.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
CPU Scheduling CSE 2431: Introduction to Operating Systems
Presentation transcript:

Lecture 24: Process Scheduling Examples and for Real-time Systems

Review: Categories of Process Scheduling Batch Systems (Compute Servers) Many processes, not interactive, throughput is important Interactive Systems PC Real Time Systems Guaranteed response times, meet deadlines

Scheduling Algorithm Goals All Systems Fairness – giving each process a fair share of the CPU Policy enforcement – seeing that stated policy is carried out Balance – keeping all parts of the system busy

Review: Scheduling Algorithms for Batch Systems First come first serve Shortest job first Shortest remaining time next

Review: Scheduling Algorithms for Interactive Systems Round-Robin scheduling Priority scheduling Multiple queues Lottery scheduling

FCFS Arrival time CPU burst P1: 4 36 8 112 1 13 I/O burst 16 13 16 20 P1: 4 36 8 112 1 I/O burst P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1

FCFS 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Which process goes next? P1 idle P2 P3 P4 0 4 13 36 40 42

FCFS Time next ready 40 76 60 192 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Which process goes next? P1 idle P2 P3 P4 0 4 13 36 40 42

FCFS Time next ready 40 76 60 192 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 P1 idle P2 P3 P4 P1 idle P3 0 4 13 36 40 42 50 60 172

FCFS 162 76 212 192 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 P1 idle P2 P3 P4 P1 idle P3 P2 P1 idle P4 0 4 13 36 40 42 50 60 172 174 175 192

RR, Q = 10 Arrival time CPU burst P1: 4 36 8 112 1 13 I/O burst 16 13 16 20 P1: 4 36 8 112 1 I/O burst P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Gantt chart

RR, Q = 10 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Which process goes next, and when? Gantt chart P1 idle P2 P3 P4 0 4 13 23 27 29

RR, Q = 10 40 82 47 179 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Gantt chart P1 idle P2 P3 P4 P2 0 4 13 23 27 29 42

RR, Q = 10 162 End Run 179 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Gantt chart P1 idle P2 P3 P4 P2 P1 P3 P2 P3 0 4 13 23 27 29 42 50 90 92

RR, Q = 10 End 205 179 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Gantt chart P1 idle P2 P3 P4 P2 P1 P3 P2 P3 P1 P3 idle 0 4 13 23 27 29 42 50 90 92 162 163 165

MLFQ: Q0 = 8, Q1 = 16, Q2 =  40 q1 45 177 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 15 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Gantt chart 1 idle 2 3 4 2 0 4 13 21 25 27

MLFQ: Q0 = 8, Q1 = 16, Q2 =  160 q1 177 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 2 P3: 4 20 112 40 2 40 2 40 1 104 P4: 2 150 3 10 1 Gantt chart 1 idle 2 3 4 2 1 3 0 4 13 21 25 27 40 48 56

MLFQ: Q0 = 8, Q1 = 16, Q2 =  160 98 q2 177 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 64 P4: 2 150 3 10 1 Gantt chart 1 idle 2 3 4 2 1 3 2 3 0 4 13 21 25 27 40 48 56 58 98

MLFQ: Q0 = 8, Q1 = 16, Q2 =  end q2 190 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 4 P4: 2 150 3 10 1 Gantt chart 1 idle 2 3 4 2 1 3 2 3 2 3 1 3 idle 0 4 13 21 25 27 40 48 56 58 98 100 160 161 165

Real-time Scheduling Definition Performance measure Key property Systems whose correctness depends on their temporal aspects as well as their functional aspects Performance measure Timeliness on timing constraints (deadlines) Speed/average case performance are less significant. Key property Predictability on timing constraints

Real-time Scheduling Absolute deadline Released Execution time Relative deadline

Deadlines: Hard vs. Soft Hard deadline Disastrous or very serious consequences may occur if the deadline is missed Validation is essential : can all the deadlines be met, even under worst-case scenario? Deterministic guarantees Soft deadline Ideally, the deadline should be met for maximum performance. The performance degrades in case of deadline misses. Best effort approaches / statistical guarantees

RM (Rate Monotonic) Optimal static-priority scheduling It assigns priority according to period A task with a shorter period has a higher priority Executes a job with the shortest period T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

EDF (Earliest Deadline First) Optimal dynamic priority scheduling A task with a shorter deadline has a higher priority Executes a job with the earliest deadline T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)