11 G53SRP: Deadline misses and cost over-runs in RTSJ Chris Greenhalgh School of Computer Science.

Slides:



Advertisements
Similar presentations
Introduction to Embedded Systems Resource Management - III Lecture 19.
Advertisements

© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
CSE 522 Real-Time Scheduling (4)
Programming R-T Abstractions TSW November 2009 Anders P. Ravn Aalborg University.
© 2004, D. J. Foreman 1 O/S Organization. © 2004, D. J. Foreman 2 Topics  Basic functions of an OS ■ Dev mgmt ■ Process & resource mgmt ■ Memory mgmt.
© 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.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6 Threads and Scheduling 6.
© Andy Wellings, 2003 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Enhancing the Platform Independence of the Real-Time Specification for Java Andy Wellings, Yang Chang and Tom Richardson University of York.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
Clocks & Asynchronous Events. Overview Clocks  API  Implementation Asynchronous Events  API  Single Threaded Model  Multi-Threaded Model  Code Walkthrough.
The Real-Time Java Profile ITV Real-Time Systems Anders P. Ravn Aalborg University February 2006.
Dreams in a Nutshell Steven Sommer Microsoft Research Institute Department of Computing Macquarie University.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Real-Time Java Martin Schöberl. Real Time Java2 Overview What are real-time systems Real-time specification for Java RTSJ issues, subset Real-time profile.
Implementing Processes and Process Management Brian Bershad.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Monitoring Deadline Misses in Periodic Real-time Threads Prepared By: Ebtesam Saleh Prepared For: Eng. Tasneem Darwesh University of Palestine.
Instructore: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Concurrent and.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Tami Meredith, Ph.D. CSCI  Devices need CPU access  E.g., NIC has a full buffer it needs to empty  These device needs are often asynchronous.
Enhancements to Java for Real Time Systems Theresa Dsena CSE Fall 2006 Prof. Ganesan.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his.
Threaded Programming in Python Adapted from Fundamentals of Python: From First Programs Through Data Structures CPE 401 / 601 Computer Network Systems.
1 G53SRP: Java Concurrency Control (1) - synchronisation Chris Greenhalgh School of Computer Science.
EEL Real-time Java part 2. EEL Acknowledgements All the lecture slides were adopted from the slides of Andy Wellings.
111 G53SRP: RTSJ Memory Areas Chris Greenhalgh School of Computer Science.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Unix System Calls and Posix Threads.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
12/22/ Thread Model for Realizing Concurrency B. Ramamurthy.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Real time scheduling G.Anuradha Ref:- Stallings. Real time computing Correctness of the system depends not only on the logical result of computation,
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Synchronization Emery Berger and Mark Corner University.
Thread Scheduling and Dispatching Maung Aung Han Marc E. Loy Jihua Zhong CIS 642: Seminar in Real-time Systems Instructor: Professor Insup Lee.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Operating Systems CMPSC 473 Signals, Introduction to mutual exclusion September 28, Lecture 9 Instructor: Bhuvan Urgaonkar.
11 G53SRP: Feasibility analysis Chris Greenhalgh School of Computer Science.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
1 G53SRP: Java Concurrency Control (2) – wait/notify Chris Greenhalgh School of Computer Science.
1 G53SRP: Introduction to Real Time Scheduling Chris Greenhalgh School of Computer Science.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
Introduction to Operating Systems Concepts
Jim Fawcett CSE687-OnLine – Object Oriented Design Summer 2017
Jim Fawcett CSE687 – Object Oriented Design Spring 2001
Threaded Programming in Python
Jim Fawcett CSE687 – Object Oriented Design Spring 2015
Protection of System Resources
G53SRP: Real Time Threads in RTSJ (part I)
G53SRP: Asynchronous Events in RTSJ
Module 2: Computer-System Structures
G53SRP: Resource Sharing Issues
Processor Fundamentals
CSCI1600: Embedded and Real Time Software
Unix System Calls and Posix Threads
Multithreading.
Lecture Topics: 11/1 General Operating System Concepts Processes
Threaded Programming in Python
Quiz.
Module 2: Computer-System Structures
Scheduling Basic Concepts Ref: Hard Real-Time Computing Systems Giorgio Buttazzo Ref: Real-Time Systems & Software Alan Shaw Processes - Tasks.
CSCI1600: Embedded and Real Time Software
- When you approach operating system concepts there might be several confusing terms that may look similar but in fact refer to different concepts:  multiprogramming, multiprocessing, multitasking,
A Top-Level View Of Computer Function And Interconnection
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

11 G53SRP: Deadline misses and cost over-runs in RTSJ Chris Greenhalgh School of Computer Science

22 Contents Handling missed deadlinesHandling missed deadlines –In Periodic RealtimeThreads –In other cases Handling cost over-runsHandling cost over-runs –In periodic RealtimeThreds SummarySummary Book: Wellings , 11.3, , 12.4Book: Wellings , 11.3, , 12.4

3 Handling missed deadlines Every Schedulable has a deadlineEvery Schedulable has a deadline –Part of ReleaseParameters –Measured from its release time Every Schedulable may also have a deadline miss handlerEvery Schedulable may also have a deadline miss handler –An AsyncEventHandler With SchedulerParameters, etc.With SchedulerParameters, etc. –Also specified in ReleaseParameters Deadline miss handler (if specified) is released as soon as the deadline is missedDeadline miss handler (if specified) is released as soon as the deadline is missed See HelloDeadlineMissHandler.java

4 In Periodic RealtimeThreads (With deadline miss handler) In waitForNextPeriod – –No deadline miss: returns after next release – –After deadline miss: RealtimeThread is de-scheduled unless schedulePeriodic() has been called since deadline miss Most likely by deadline miss handler! See HelloSchedulePeriodic.java

5 De/schedulePeriodic RealtimeThread : – –deschedulePeriodic() deschedules future releases waitForNextPeriod() will block – –schedulePeriodic() schedules thread at next release – –Any releases occurring between deschedulePeriodic and schedulePeriodic are lost e.g. after deadline miss but before re-schedule

6 In other cases RTSJ 1.0.1/2 does not adequately specify deadline miss (and cost overrun) behaviour for – –Aperiodic and sporadic RealtimeThreads Not supported at all – –AsyncEventHandlers No clean API, e.g. to deschedule/reschedule AsyncEventHandlers May be added in 1.1 – –but doesn’t seem to be at present

AsyncEventHandlers in Deadline handler released as soon as deadline missedDeadline handler released as soon as deadline missed –independently for each firing By default the handler continues to executeBy default the handler continues to execute –Pending executions can be manipulated via etc. AsyncEventHandler getPendingFireCount Note: they are protected, i.e. from within handler onlyNote: they are protected, i.e. from within handler only –Future releases can be manipulated via AsyncEvent add / removeHandler 7 See DeadlineMissAsyncEventHandler.java

Aperiodic and Sporadic threads in RTSJ 1.1 Adds new methods to RealtimeThread comparable to those for periodic processes:Adds new methods to RealtimeThread comparable to those for periodic processes: –waitForNextRelease() cf. waitForNextPeriod() Block until next release of aperiodic threadBlock until next release of aperiodic thread –waitForNextReleaseInterruptible() cf. waitForNextPeriodInterruptible() Ditto, but open to interruptionDitto, but open to interruption –schedule() cf. schedulePeriodic() (re)Schedule, e.g. after deadline miss(re)Schedule, e.g. after deadline miss –deschedule() cf. deschedulePeriodic() Do not scheduleDo not schedule –release() –release the thread, cf. AsyncEvent fire() start() is the first release!start() is the first release! 8

9 Handling cost overruns Every Schedulable has a CPU cost (time)Every Schedulable has a CPU cost (time) –Part of ReleaseParameters –Actual time (units) on CPU Every Schedulable may also have a cost overrun handlerEvery Schedulable may also have a cost overrun handler –An AsyncEventHandler With SchedulerParameters, etc.With SchedulerParameters, etc. –Also specified in ReleaseParameters Note: not all implementations support cost monitoring, in fact most don’t at presentNote: not all implementations support cost monitoring, in fact most don’t at present –depends on OS support

10 Cost overruns On cost over-run: – –Over-running Schedulable is immediately descheduled – –Cost overrun handler (if any) is released Schedulable is re-scheduled if – –Its cost is increased – –Its CPU budget is increased i.e. next release of a periodic RealtimeThread Presumably in RTSJ 1.1 release of other cases also – –under-specified in RTSJ1.0.1 See HelloCostOverrunHandler.java

11 Summary Missed deadlines & cost over-runMissed deadlines & cost over-run –Specified by ReleaseParameters deadline –Results in call to deadline miss or cost overrun handler –In Periodic RealtimeThreads Deadline miss requires schedulePeriodic to resume threadDeadline miss requires schedulePeriodic to resume thread Cost overrun requires new release or increase of costCost overrun requires new release or increase of cost –Under-defined in other cases in RTSJ Defined for aperiodic/sporadic threads in RTSJ 1.1Defined for aperiodic/sporadic threads in RTSJ 1.1