Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.

Slides:



Advertisements
Similar presentations
Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
Advertisements

Real Time Scheduling.
Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Priority Inheritance and Priority Ceiling Protocols
Introduction to Embedded Systems Resource Management - III Lecture 19.
Priority INHERITANCE PROTOCOLS
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
Real-Time Mutli-core Scheduling Moris Behnam. Introduction Single processor scheduling – E.g., t 1 (P=10,C=5), t 2 (10, 6) – U= >1 – Use a faster.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
0 Synchronization Problem Resource sharing –Requires mutual exclusion –Critical section A code section that should be executed mutually exclusively by.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Access Control Protocols.
CSE 522 Real-Time Scheduling (3)
Real Time Scheduling Terminologies define Fixed Priority Scheduler
CSE 522 Real-Time Scheduling (4)
An Introduction to Real Time Systems
Task Allocation and Scheduling n Problem: How to assign tasks to processors and to schedule them in such a way that deadlines are met n Our initial focus:
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.
Chapter 6 Dynamic Priority Servers
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.
Spring 2002Real-Time Systems (Shin) Rate Monotonic Analysis Assumptions – A1. No nonpreemptible parts in a task, and negligible preemption cost –
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –
More Scheduling cs550 Operating Systems David Monismith.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Combined Scheduling of Periodic and Aperiodic Tasks.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Scheduling policies for real- time embedded systems.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
RTOS task scheduling models
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2006 Universität Dortmund Periodic scheduling For periodic scheduling, the best that we can do is to.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Introduction to Embedded Systems Rabie A. Ramadan 5.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Distributed Process Scheduling- Real Time Scheduling Csc8320(Fall 2013)
Embedded System Scheduling
REAL-TIME OPERATING SYSTEMS
OPERATING SYSTEMS CS 3502 Fall 2017
Chapter 6: CPU Scheduling (Cont’d)
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Scheduling and Resource Access Protocols: Basic Aspects
Applied Operating System Concepts -
EEE 6494 Embedded Systems Design
Chapter 2 Scheduling.
Lecture 4 Schedulability and Tasks
Lecture 24: Process Scheduling Examples and for Real-time Systems
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
ICS 143 Principles of Operating Systems
Rate Monotonic Analysis For Real-Time Scheduling A presentation for
Module 5: CPU Scheduling
Realtime Scheduling Algorithms
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall /27/2018.
Real Time Scheduling Mrs. K.M. Sanghavi.
Chapter5: CPU Scheduling
CSCI1600: Embedded and Real Time Software
CPU scheduling decisions may take place when a process:
Multiprocessor and Real-Time Scheduling
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy Amrita-UB-MSES /11/2013.
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Real-Time Process Scheduling Concepts, Design and Implementations
The End Of The Line For Static Cyclic Scheduling?
Chapter 6: CPU Scheduling
Real-Time Process Scheduling Concepts, Design and Implementations
Presentation transcript:

Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point

Real Time Systems Specifications -> Task Set Task Specifications Scheduling Fixed Priority Scheduling Dependent tasks Dynamic Priority Scheduling Aperiodic Tasks

Task Specifications A task is a collection of jobs J1,J2,J3,… A job is a set of instructions to be executed A job is specified in time by: a ready time r, a computation time c and a deadline d

The job life cycle Time Running Completed C Scheduled S Ready r Computation time c Deadline d Pre-emptied

Task Specifications Periodic tasks Aperiodic tasks Sporadic tasks Hard Real Time Real Time Soft Real Time Non Real Time

Task Specifications r1 Time r4 T r2 TTT Periodic Task r3

Task Specifications r1 Time r4r2 Aperiodic Task r3 T3 0 < Ti, 0 < c << T, (Ti < c) T1T2

Task Specifications r1 Time r4r2 Sporadic Task r3 T3 0 < c << Tmin < Ti T1T2

Task Specifications Hard Real Time: d <= Tmin (T), (periodic,sporadic) Real Time: d > Tmin (T), (periodic, sporadic) Soft Real Time: C < d (periodic,aperiodic) Non Real Time

Scheduling For periodic and sporadic tasks: {T i, c i },  c i / T i = U 1, unstable) For aperiodic tasks: r i = c i / T i, U=  r i < 1

Scheduling Pre emptive Non Pre emptive Fixed Schedules Cyclic Schedules Round Robin Fixed Priorities Rate/Deadline Monotonic Dynamic Priorities Earliest Deadline First

Fixed Schedules Ready times need to be known a priori Only very light run time load Table based Less flexible Cyclic schedules are fixed schedules

Cyclic Schedules All periods are multiples of dT LCM: is the Least Common Multiple Schedule is made for [0, dt * LCM] If CPU is idle at dT * LCM the schedule may be reused in subsequent intervals. Applicable both for Pre emptive and Non Pre Emptive Schedules

Cyclic Schedules (example) T1=2,c1=1,d1=2 T2=3,c2=3/2,d2=3 Task Time

Round Robin Time line divided into slots dT Tasks are granted execution time cyclically. When a job has executed for dT or is completed CPU access is passed on. Non pre emptive if dT is infinite. Critical instant when grant is just passed on when job is ready along with jobs from all other tasks

Round Robin (example) T1=2,c1=1,d1=2 T2=3,c2=3/2,d2=3, dT=1/ Task Time Task Time 1 2 Test for task 2 Test for task 1

Fixed Priorities Tasks are assigned priorities in order               A task is ready if its latest job is still not completed A task is running if it is ready and it has highest priority among ready tasks. Both pre emptive and non preemptive

Fixed priorities (example) T1=2,c1=1,d1=2 T2=3,c2=3/2,d2=3, preemptive Task Time Task 2 missed deadline

Fixed priorities (properties) Flexible Medium run time demands Not optimal Typically better then Round Robin Well known schedulability criteria

Fixed Priorities (schedulability) Critical Instant Theorem (Liu,Layland) Worst case completion time is when launced along with jobs from all other tasks simultaneously. Utilization U 0.7 < 1 !! Completion time: exist t  i  [t / T j ] c j + c i

Fixed Priorities (example) T1=2,c1=1,d1=2 T2=3,c2=3/2,d2=3, preemptive c2=3/2 c1=1 T1=2 C2=3½ > d2= Time Work

Priority Order Priorities according to importance or time efficiency. DMA: d1 < d2 < d3 <.. < dN DMA (Deadline Monotonic) / RMA (Rate Monotonic) is optimal when d<=T / d=T No general optimal order when d>T

Dependent tasks Inter Process Communication (IPC) Critical regions Producer Consumer Rendezvous All introduce dependence

Critical regions (example) 22 33 Time Running W(S) 11 S(S) Priority inversion W(S)

Priority Ceiling Priority ceil C(S) of semaphore S is the highest (minimum) priority of all tasks locking S Runtime: –if prio  < min {C(S i )| S i locked} when attempting a lock on S then lock and active. –else suspend. Task locking S inherits prio  (if lower) until unlock. Whenever a semaphore is unlocked the suspend queue is inspected to see if any task may be resumed.

Priority Ceiling (assumptions and properties) Assumption: Critical regions nicely nested. Property: No deadlocks possible Property: No task is blocked by lower priority tasks for more than the duration of 1 critical region.

Critical regions with PC (example) 22 33 Time Running W(S) W(S), suspended 11  3 -> prio(  1) W(S) S(S),  3 -> low prio.

Fixed Priorities with PC (schedulability) Completion time: exist t  i  [t / T j ] c j + c i + B i B i is the duration of the longest critical region possibly blocking tau i Lower priority tasks also block through priority inheritance

Dynamic priority scheduling At every scheduling point considers states of every job. Heavy run time load. Includes fixed schedules and fixed priorities as special cases – thus stronger Earliest Deadline First (EDF) and Least Laxity First (LLF) are special cases.

Ealiest Deadline First (EDF) At every scheduling point runs job with closest deadline. Optimal among all schedules. U < 1 sufficient for d=T No priority according to importance possible.

EDF (example) T1=2,c1=1,d1=2 T2=3,c2=3/2,d2=3 Task Time d 1,1 d 2,1 d 1,2 d 2,2 d 1,3 RMA/DMA missed deadline

Aperiodic tasks Low (close to zero) minimum interarrival time Tmin May be seen from probabilistic and worst case viewpoints Probabilistic viewpoint uses mean inter arrival times T and queueing theory. Worst case view uses Tmin. OK if c/Tmin < available CPU fraction. Aperiodic server or background task

Probabilistic viewpoint (queueing) Assumes Poisson arrivals and exponential distributed service times. (Approximation.) l=1/T : arrival rate, u: service rate. Load (utilization) r = l/u Mean queue length Q = r / (1-r) Mean waiting time W = Q/l = 1 / (u –l) (Littles theorem)

Worst case v.p. Higher priority computation times K i Higher priority utilization U i W.C. Completion time for n jobs of tau i : C n n c i + K i + t*U i } => C n < (n c i + K i ) / (1-U i ) W.C. Waiting W n = C n – r n < C n - (n-1)*Tmin < n (c i / (1-U i ) –Tmin) + K i / (1-U i ) +Tmin = (c i +K i ) / (1-U i ) for n=1

Worst Case V.P n Waiting time K i / (1- U i ) + Tmin 1 C i /(1-U i ) - Tmin (c i + K i ) / (1- U i )

Sporadic Tasks Tmin >> c Typically hard real time (alarm not.) d << Tmin No queueing. If aperiodic server T < d << Tmin (high load) Sporadic server accesible at all times, however allways Tmin between every use. Ticket issued at start up time. New ticket at n*Tmin if used – else old ticket left. High responsiveness – low load.

Sporadic Server (example) Time Tickets r1 Tmin 1 r2 r4 r3

The End