Presentation is loading. Please wait.

Presentation is loading. Please wait.

Monitoring Deadline Misses in Periodic Real-time Threads Prepared By: Ebtesam Saleh-220060051 Prepared For: Eng. Tasneem Darwesh University of Palestine.

Similar presentations


Presentation on theme: "Monitoring Deadline Misses in Periodic Real-time Threads Prepared By: Ebtesam Saleh-220060051 Prepared For: Eng. Tasneem Darwesh University of Palestine."— Presentation transcript:

1 Monitoring Deadline Misses in Periodic Real-time Threads Prepared By: Ebtesam Saleh-220060051 Prepared For: Eng. Tasneem Darwesh University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Concurrent and Real Time programming 04/01/14371ebtesam saleh - chapter 12 - section 4

2 In many soft real-time systems applications will want to monitor any deadline misses, but take no action unless a certain threshold is reached. 04/01/14372ebtesam saleh - chapter 12 - section 4 Monitoring Deadline Misses : interface

3 04/01/1437ebtesam saleh - chapter 12 - section 43 Example health monitor objec

4 import javax.realtime.*; public class HealthMonitor { public void persistentDeadlineMiss(Schedulable s); } Monitoring Deadline Misses : interface 04/01/14374ebtesam saleh - chapter 12 - section 4

5 import javax.realtime.*; class DeadlineMissHandler extends AsyncEventHandler { public DeadlineMissHandler(HealthMonitor mon, int threshold) { super(new PriorityParameters( PriorityScheduler.MAX_PRIORITY), null, null, null, null, null); myHealthMonitor = mon; myThreshold = threshold; } public void setThread(RealtimeThread rt) { myrt = rt; } 04/01/14375ebtesam saleh - chapter 12 - section 4

6 public void handleAsyncEvent() { if(++missDeadlineCount < myThreshold) myrt.schedulePeriodic(); else myHealthMonitor.persistentDeadlineMiss (myrt); } private RealtimeThread myrt; private int missDeadlineCount = 0; private HealthMonitor myHealthMonitor; private int myThreshold; } 04/01/14376ebtesam saleh - chapter 12 - section 4

7 When the handler is executed, it increments the miss count and reschedules the thread. When the count reaches the threshold, it informs the health monitor and does not reschedule the thread. Monitoring Deadline Misses 04/01/14377ebtesam saleh - chapter 12 - section 4

8 it is not possible to pass the real-time thread as a parameter to the constructor of the handler, as the handler itself is needed before the real-time thread can be constructed. Monitoring Deadline Misses 04/01/14378ebtesam saleh - chapter 12 - section 4

9 setting up the real-time periodic thread 04/01/14379ebtesam saleh - chapter 12 - section 4

10 setting up the real-time periodic thread 04/01/143710ebtesam saleh - chapter 12 - section 4

11 Deadline miss handlers are schedulable objects. Consequently, they will compete for processor time with their associated schedulable objects according to their priorities. Hence, for the handler to have an impact on the (in this case) errant real-time thread, it must have a priority higher than the real-time thread. If the priority is lower, it will not run until the errant thread blocks. Monitoring Deadline Misses 04/01/143711ebtesam saleh - chapter 12 - section 4

12 04/01/143712ebtesam saleh - chapter 12 - section 4 Questions??


Download ppt "Monitoring Deadline Misses in Periodic Real-time Threads Prepared By: Ebtesam Saleh-220060051 Prepared For: Eng. Tasneem Darwesh University of Palestine."

Similar presentations


Ads by Google