Scheduling Theory ITV Real-Time Systems Anders P. Ravn Aalborg University March 2007.

Slides:



Advertisements
Similar presentations
Real Time Scheduling.
Advertisements

Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Introduction to Embedded Systems Resource Management - III Lecture 19.
Real-Time Systems and Programming Languages © Alan Burns and Andy Wellings Chapter 12: Programming Schedulable Systems.
Priority INHERITANCE PROTOCOLS
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
From HRT-HOOD to ADA95 Real-Time Systems Lecture 5 Copyright, 2001 © Adam Czajka.
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:
Scheduling Goal Topics
Java How to Program, 9/e CET 3640 Professor: Dr. José M. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
Programming R-T Abstractions TSW November 2009 Anders P. Ravn Aalborg University.
Courseware Scheduling Uniprocessor Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Scheduling Theory ITV Multiprogramming and Real-Time Programs Anders P. Ravn Aalborg University May 2009.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Chapter 11: Scheduling Real- Time Systems
Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the RTSJ  Memory Management.
Enhancing the Platform Independence of the Real-Time Specification for Java Andy Wellings, Yang Chang and Tom Richardson University of York.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
CprE 458/558: Real-Time Systems
Spring 2002Real-Time Systems (Shin) Rate Monotonic Analysis Assumptions – A1. No nonpreemptible parts in a task, and negligible preemption cost –
UCDavis, ecs251 Fall /23/2007ecs251, fall Operating System Models ecs251 Fall 2007 : Operating System Models #3: Priority Inversion Dr. S.
Java How to Program, 9/e CET 3640 Professor: Dr. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
Real-Time Software Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Java Programming: Advanced Topics
Real Time Operating Systems Scheduling & Schedulers Course originally developed by Maj Ron Smith 8-Oct-15 Dr. Alain Beaulieu Scheduling & Schedulers- 7.
1 소프트웨어공학 강좌 Chap 11. Real-time software Design - Designing embedded software systems whose behaviour is subject to time constraints -
Real-Time Systems Design1 Priority Inversion When a low-priority task blocks a higher-priority one, a priority inversion is said to occur Assume that priorities:
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.
Instructore: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Concurrent and.
Real Time Operating Systems Schedulability - Part 3 Course originally developed by Maj Ron Smith 10/24/2015Dr Alain Beaulieu1.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
Real Time Scheduling Telvis Calhoun CSc Outline Introduction Real-Time Scheduling Overview Tasks, Jobs and Schedules Rate/Deadline Monotonic Deferrable.
Slide 1 Chapter 11 Real –time Software Designs. Slide 2 Real-time systems l Systems which monitor and control their environment l Inevitably associated.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Prepare by : Ihab shahtout.  Overview  To give an overview of fixed priority schedule  Scheduling and Fixed Priority Scheduling.
Real Time Operating Systems Mutual Exclusion, Synchronization & Intertask Communication Course originally developed by Maj Ron Smith.
Undergraduate course on Real-time Systems Linköping 1 of 45 Autumn 2009 TDDC47: Real-time and Concurrent Programming Lecture 5: Real-time Scheduling (I)
EEL Real-time Java part 2. EEL Acknowledgements All the lecture slides were adopted from the slides of Andy Wellings.
©Ian Sommerville, Robin Abraham 2004CS 361, Summer 2004 Slide 1 Real-time Software Design.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Introduction to Embedded Systems Rabie A. Ramadan 5.
A presentation for Brian Evans’ Embedded Software Class By Nate Forman Liaison Technology Inc. 3/30/2000 For Real-Time Scheduling.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Thread Scheduling and Dispatching Maung Aung Han Marc E. Loy Jihua Zhong CIS 642: Seminar in Real-time Systems Instructor: Professor Insup Lee.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
11 G53SRP: Feasibility analysis Chris Greenhalgh School of Computer Science.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
1 G53SRP: Introduction to Real Time Scheduling Chris Greenhalgh School of Computer Science.
Undergraduate course on Real-time Systems Linköping TDDD07 – Real-time Systems Lecture 1: Introduction & Scheduling I Simin Nadjm-Tehrani Real-time Systems.
Real-time Software Design
REAL-TIME OPERATING SYSTEMS
Unit OS9: Real-Time and Embedded Systems
G53SRP: Real Time Threads in RTSJ (part I)
EEE 6494 Embedded Systems Design
Real-time Software Design
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall /27/2018.
G53SRP: Resource Sharing Issues
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Real-Time Process Scheduling Concepts, Design and Implementations
Real-Time Process Scheduling Concepts, Design and Implementations
Presentation transcript:

Scheduling Theory ITV Real-Time Systems Anders P. Ravn Aalborg University March 2007

Characteristics of a RTS Timing Constraints Dependability Requirements Concurrent control of separate components Facilities to interact with special purpose hardware

Real-Time Facilities Topics –Notion of time –Clocks, delays and timeouts –Specifying timing requirements –Temporal scopes

Temporal Scopes Includes: –deadline for completion of execution –minimum delay before start of execution –maximum delay before start of execution –maximum execution time –maximum elapse time Can be –Periodic –Sporadic –Aperiodic Deadlines can be : l Hard l Soft l Interactive — performance issue l Firm

Now Time Deadline a b c Minimum delay Maximum delay Maximum elapse time Units of execution Maximum execution time = a + b +c

Scheduling Last Time: –Simple process model –The cyclic executive approach –Process-based scheduling –Utilization-based schedulability tests –Response time analysis for FPS –Worst-case execution time R  D ii

Simple Process Model The application has a fixed set of processes All processes are periodic, with known periods The processes are independent of each other All processes have deadline equal to their period All processes have a worst-case execution time. All context-switching costs etc. are ignored

Sporadic Processes They have minimum inter-arrival time They also require D<T Response Time Analysis – applies Deadline Monotonic Priority Assignment is Optimal

Aperiodic Processes No minimum inter-arrival time Can run at a lowest priority. Alternative: a server with period T s and capacity C s can be employed. Often with highest priority.

Simple Process Model The application has a fixed set of processes Sporadic and periodic processes have known T All processes have a deadline … The processes are independent of each other All processes have a worst-case execution time All context-switching costs etc. are ignored

Process Interactions: Blocking If a process waits for a lower-priority process then it suffers priority inversion. It is blocked. Example: periodic processes: a, b, c and d ; and two resources: Q and V Process Priority Execution Sequence Release Time a 1 EQQQQE 0 b 2 EE 2 c 3 EVVE 2 d 4 EEQVE 4

Example of Priority Inversion Process a b c d Executing Executing with Q locked Preempted Executing with V locked Blocked

Priority Inheritance If process p blocks q, then p gets q 's priority Process a b c d

Calculating Blocking

Priority Ceiling Protocols Two forms Original ceiling priority protocol Immediate ceiling priority protocol

OCPP Each process has a static default priority Each resource has a static ceiling value defined, the maximum priority of the processes that use it A process has the maximum of its own static priority and any it inherits due to it blocking higher-priority processes. A process can only lock a resource if its dynamic priority is higher than the ceiling of any currently locked resource (excluding any that it has already locked itself)

OCPP Inheritance a b c d Process

ICPP Each process has a static default priority Each resource has a static ceiling value, this is the maximum priority of the processes that use it. A process has a dynamic priority that is the maximum of its own static priority and the ceiling values of any resources it has locked As a consequence, a process will only suffer a block at the very beginning of its execution.

ICPP Inheritance a b c d Process

On a Single Processor A high-priority process is blocked at most once during its execution by lower-priority processes. Deadlocks are prevented Transitive blocking is prevented Mutual exclusive access to resources is ensured by the protocol itself

OCPP versus ICPP Although the worst-case behaviour of the two ceiling schemes is identical (from a scheduling view point), there are some points of difference: –ICCP is easier to implement than the original (OCPP) as blocking relationships need not be monitored –ICPP leads to less context switches as blocking is prior to first execution –ICPP requires more priority movements as this happens with all resource usage –OCPP changes priority only if an actual block has occurred

Simple Process Model The application has a fixed set of processes Sporadic and periodic processes have known T All processes have a deadline … The processes are independent of each other All processes have a worst-case execution time All context-switching costs etc. are ignored

Extensions Cooperative Scheduling Release Jitter Arbitrary Deadlines Fault Tolerance Offsets Optimal Priority Assignment

Release Jitter

Arbitrary Deadlines

Fault Tolerance

Interrupts Drivers are treated as sporadic processes.

Context Switches Chapter 16.3 and onwards …

The Schedulable Interface public interface Schedulable extends java.lang.Runnable { public void addToFeasibility(); public void removeFromFeasibility(); public MemoryParameters getMemoryParameters(); public void setMemoryParameters(MemoryParameters memory); public ReleaseParameters getReleaseParameters(); public void setReleaseParameters(ReleaseParameters release); public SchedulingParameters getSchedulingParameters(); public void setSchedulingParameters(SchedulingParameters scheduling); public Scheduler getScheduler(); public void setScheduler(Scheduler scheduler); }

Scheduling Parameters public abstract class SchedulingParameters { public SchedulingParameters(); } public class PriorityParameters extends SchedulingParameters { public PriorityParameters(int priority); public int getPriority(); // at least 28 priority levels public void setPriority(int priority) throws IllegalArgumentException;... } public class ImportanceParameters extends PriorityParameters { public ImportanceParameters(int priority, int importance); public int getImportance(); public void setImportance(int importance);... }

RT Java: Scheduler Real-Time Java supports a high-level scheduler whose goals are: –to decide whether to admit new schedulable objects according to the resources available and a feasibility algorithm, and –to set the priority of the schedulable objects according to the priority assignment algorithm associated with the feasibility algorithm Real-Time Java addresses more dynamic systems with the potential for on-line analysis

The Scheduler public abstract class Scheduler { public Scheduler(); protected abstract void addToFeasibility(Schedulable s); protected abstract void removeFromFeasibility(Schedulable s); public abstract boolean isFeasible(); // checks the current set of schedulable objects public boolean changeIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory); public static Scheduler getDefaultScheduler(); public static void setDefaultScheduler(Scheduler scheduler); public abstract java.lang.String getPolicyName(); }

The Priority Scheduler class PriorityScheduler extends Scheduler { public PriorityScheduler() protected void addToFeasibility(Schedulable s);... public void fireSchedulable(Schedulable schedulable); public int getMaxPriority(); public int getMinPriority(); public int getNormPriority(); public static PriorityScheduler instance();... } Standard preemptive priority-based scheduling

Summary A scheduling scheme defines an algorithm for resource sharing and a means of predicting the worst-case behaviour of an application. With a cyclic executive, the application code must be packed into a fixed number of minor cycles such that the cyclic execution of the sequence of minor cycles (the major cycle) will enable all system deadlines to be met Simple utilization-based schedulability tests are not exact.

Summary Response time analysis is flexible and caters for: –Periodic and sporadic processes –Blocking caused by IPC –Cooperative scheduling –Arbitrary deadlines –Release jitter –Fault tolerance –Offsets –...