1 G53SRP: Introduction to Real Time Scheduling Chris Greenhalgh School of Computer Science.

Slides:



Advertisements
Similar presentations
EE5900 Advanced Embedded System For Smart Infrastructure
Advertisements

Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
REAL TIME SYSTEM Scheduling.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 2.
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.
Basic Real Time Concepts Systems Concepts Real-Time Definitions Events and Determinism CPU Utilization Real-Time System Design Issues Example Real-Time.
Scheduling Theory ITV Real-Time Systems Anders P. Ravn Aalborg University March 2007.
© 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.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Real-Time Systems and Programming Languages
Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the RTSJ  Memory Management.
Real-Time Systems – The big Picture
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 –
Misconceptions About Real-time Computing : A Serious Problem for Next-generation Systems J. A. Stankovic, Misconceptions about Real-Time Computing: A Serious.
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
EMBEDDED SOFTWARE Team victorious Team Victorious.
Java How to Program, 9/e CET 3640 Professor: Dr. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
Introduction to Embedded Systems
Real-Time Software Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Advanced Operating Systems CIS 720 Lecture 1. Instructor Dr. Gurdip Singh – 234 Nichols Hall –
More Scheduling cs550 Operating Systems David Monismith.
1 소프트웨어공학 강좌 Chap 11. Real-time software Design - Designing embedded software systems whose behaviour is subject to time constraints -
Round Robin Scheduling A preemptive scheduling designed for Time Sharing Systems The Ready Queue is treated as a circular queue A small execution.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
EEL Software development for real-time engineering systems.
Scheduling policies for real- time embedded systems.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
1 RTOS Design Some of the content of this set of slides is taken from the documentation existing on the FreeRTOS website
Instructore: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Concurrent and.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
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 SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his.
EEL The Real-Time Specification for Java (1)
5 May CmpE 516 Fault Tolerant Scheduling in Multiprocessor Systems Betül Demiröz.
Introduction Object oriented design is a method where developers think in terms of objects instead of procedures or functions. SA/SD approach is based.
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)
Real Time Systems Real-Time Schedulability Part I.
©Ian Sommerville, Robin Abraham 2004CS 361, Summer 2004 Slide 1 Real-time Software Design.
Module 2 Overview of Real Time System Scheduling
Introduction to Embedded Systems Rabie A. Ramadan 5.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Introduction to Real-Time Systems
For a good summary, visit:
11 G53SRP: Feasibility analysis Chris Greenhalgh School of Computer Science.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
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 Operating Systems RTOS For Embedded systems.
Real-time Software Design
Real-time Software Design
Real-time Software Design
REAL-TIME OPERATING SYSTEMS
Processes and threads.
Advanced Operating Systems CIS 720
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
G53SRP: Real Time Threads in RTSJ (part I)
Real-time Software Design
Lecture 24: Process Scheduling Examples and for Real-time Systems
Chapter 6: CPU Scheduling
Realtime Scheduling Algorithms
G53SRP: Resource Sharing Issues
Processor Fundamentals
Presentation transcript:

1 G53SRP: Introduction to Real Time Scheduling Chris Greenhalgh School of Computer Science

2 Contents Specifying timing constraintsSpecifying timing constraints Specifying the systemSpecifying the system Current system exampleCurrent system example –Tasks, values, time lines General strategyGeneral strategy –Fixed Priority Scheduling & DMPO Further issuesFurther issues –Modes, fault tolerance, resource contention Book: Wellings ; Burns & Wellings Book: Wellings ; Burns & Wellings

3 Real time… A real-time system is any information processing system which has to respond to externally generated input stimuli within a finite and specified periodA real-time system is any information processing system which has to respond to externally generated input stimuli within a finite and specified period –the correctness depends not only on the logical result but also the time it was delivered

4 Specifying timing constraints: temporal scopes For a section of code (“process”, “task”, “scope”, Java Runnable), specify:For a section of code (“process”, “task”, “scope”, Java Runnable), specify: –When it should (nominally) start –When it must be completed by class Foo implements Runnable { public void run() public void run() { … }}

5 Release Time a b c Units of execution i.e. actually on CPU Minimum delay Maximum delay Maximum execution time = a + b +c Maximum elapsed time Deadline Blocking (sleeping, waiting, I/O), other task(s) running

6 Specifying the system Decompose into a fixed set of tasksDecompose into a fixed set of tasks For each task:For each task: –Specify when it should be started E.g. periodic (repeated, on a timer) or triggered by some other/external event (such as an interrupt)E.g. periodic (repeated, on a timer) or triggered by some other/external event (such as an interrupt) –Specify then deadline within which it should finish Timing requirements derived from specification, e.g. system stability requirementsTiming requirements derived from specification, e.g. system stability requirements Arrange for the system to run those tasks at the right times and in the right orderArrange for the system to run those tasks at the right times and in the right order

7 T S P Concurrency Example (review) Overall objective is to keep the temperature and pressure of some chemical process within well-defined limitsOverall objective is to keep the temperature and pressure of some chemical process within well-defined limits Switch ADC DACScreen Heater Thermocouples Pressure Transducer Pump/Valve

8 Example system processes (or “tasks”, …) P1 - temperature control taskP1 - temperature control task –(say) Run once every 100ms –Complete within 50ms P2 – pressure control taskP2 – pressure control task –Run once every 150ms –Complete within 100ms

9 Example system abstract time-line Time (ms) Process P1 P2 Process Release Time Process Completion Time Deadline Possible task execution

10 More questions… How long will each task actually take execute?How long will each task actually take execute? In what order should the tasks be executed?In what order should the tasks be executed? How many processors does the system have?How many processors does the system have? –If more than one, on which processor should each task be run? Will the deadlines be met?Will the deadlines be met?

11 More questions… example system How long will each task actually take execute?How long will each task actually take execute? –(say) P1 40ms, P2 60ms In what order should the tasks be executed?In what order should the tasks be executed? –(say) P1 before P2 How many processors does the system have?How many processors does the system have? –(say) 1 Will the deadlines be met?Will the deadlines be met? –See next slide…

12 60 Example system concrete time-line Time (ms) Process P1 P2 Process Release Time Process Completion Time Deadline missed Actual task execution Process Completion Time Deadline met Task waiting/ pre-empted 5010 All deadlines met

13 Example system Gantt Chart P1P2P1P2P Time (ms) P2 CPU-1

14 More questions… example system (v.2) How long will each task actually take execute?How long will each task actually take execute? –(say) P1 40ms, P2 70ms In what order should the tasks be executed?In what order should the tasks be executed? –(say) P1 before P2 How many processors does the system have?How many processors does the system have? –(say) 1 Will the deadlines be met?Will the deadlines be met? –See next slide…

15 60 Example system (v.2) concrete time-line Time (ms) Process P1 P2 Process Release Time Process Completion Time Deadline missed Actual task execution Process Completion Time Deadline met Task waiting/ pre-empted 5020 P2 deadlines missed  10

16 More questions… example system (v.3) How long will each task actually take execute?How long will each task actually take execute? –(say) P1 40ms, P2 60ms In what order should the tasks be executed?In what order should the tasks be executed? –(say) P2 before P1 How many processors does the system have?How many processors does the system have? –(say) 1 Will the deadlines be met?Will the deadlines be met? –See next slide…

17 60 Example system (v.3) concrete time-line Time (ms) Process P1 P2 Process Release Time Process Completion Time Deadline missed Actual task execution Process Completion Time Deadline met Task waiting/ pre-empted 60 First P1 deadline missed 

18 General answers… (1) How long will each task actually take execute?How long will each task actually take execute? –i.e. worst-case execution time –Determine from static code analysis and/or controlled testing

19 General answers… (2) In what order should the tasks be executed?In what order should the tasks be executed? 1.Decide a general strategy, (e.g.) fixed priority scheduling –Assign a priority to each process in advance and always run the highest-priority runnable process –(Want a strategy that is flexible but deterministic and analysable – and supported)

20 2.Assign priorities to each process, (e.g.) Shortest Deadline First –Also known as Deadline Monotonic Priority Ordering (DPMO) –Can be shown to be optimal, i.e. if any strategy works then this will Example system: P1 deadline 40 < P2 deadline 60Example system: P1 deadline 40 < P2 deadline 60

21 General answers… (3) How many processors does the system have? If more than one, on which processor should each task be run?How many processors does the system have? If more than one, on which processor should each task be run? –Depends on system design –Typically fix tasks to processors for predictability

22 General answers… (4) Will the deadlines be met?Will the deadlines be met? –Can be tackled through static analysis of whole system –E.g. response time analysis - see later notes Note: equivalent to example time-line with all processes released at time zeroNote: equivalent to example time-line with all processes released at time zero –N.B. this is what we were after: predictable timing behaviour

23 Further issues: modes Many systems have different “modes” of operationMany systems have different “modes” of operation –e.g. start-up, active, shut-down –Each may have its own Specified process setSpecified process set Timing parametersTiming parameters PrioritiesPriorities Scheduling analysisScheduling analysis –Plus changes between modes must be checked

24 Further issues: fault tolerance What if the running system does…What if the running system does… –Miss a deadline? –Use more processor time than it should? System maySystem may –Detect missed deadlines or cost overrun –Interrupt or suspect that process –Call an error handler, to take contingency actions

25 Further issues: resource contention If processesIf processes –share resources (e.g. common data or devices) –and require exclusive access (i.e. locks) then this must be taken into account when –setting process priorities perhaps dynamically – see later notesperhaps dynamically – see later notes –analysing the system’s schedulability may introduce additional process blockingmay introduce additional process blocking

26 Summary A real-time system is comprised of tasks or processes with specified timing constraintsA real-time system is comprised of tasks or processes with specified timing constraints –When/how often it should happen –When it should finish by (deadline) –How long it would take in isolation (cost) The real-time system schedules these tasksThe real-time system schedules these tasks –e.g. using fixed priority scheduling and deadline-monotonic priority ordering

27 Summary (2) On- or off-line analysis of the system can then determine whether deadlines should be met or notOn- or off-line analysis of the system can then determine whether deadlines should be met or not Missed deadlines or cost over-runs may be detected, allowing the system to respond to failures (fault tolerance)Missed deadlines or cost over-runs may be detected, allowing the system to respond to failures (fault tolerance) Scheduling and analysis may be complicated by (e.g.) system modes or contention for shared resourcesScheduling and analysis may be complicated by (e.g.) system modes or contention for shared resources