Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "11 G53SRP: Deadline misses and cost over-runs in RTSJ Chris Greenhalgh School of Computer Science."— Presentation transcript:

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

2 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 10.4.1, 11.3, 12.1.1, 12.4Book: Wellings 10.4.1, 11.3, 12.1.1, 12.4

3 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 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 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 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

7 AsyncEventHandlers in 1.0.2 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

8 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 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 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 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 1.0.2 Defined for aperiodic/sporadic threads in RTSJ 1.1Defined for aperiodic/sporadic threads in RTSJ 1.1


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

Similar presentations


Ads by Google