+ All Categories
Home > Documents > Monitoring Deadline Misses in Periodic Real-time Threads Prepared By: Ebtesam Saleh-220060051...

Monitoring Deadline Misses in Periodic Real-time Threads Prepared By: Ebtesam Saleh-220060051...

Date post: 13-Jan-2016
Category:
Upload: homer-caldwell
View: 212 times
Download: 0 times
Share this document with a friend
Popular Tags:
12
Monitoring Deadline Monitoring Deadline Misses in Periodic Misses in Periodic Real-time Threads Real-time Threads Prepared By: Ebtesam Saleh- Prepared By: Ebtesam Saleh- 220060051 220060051 Prepared For: Eng. Tasneem Prepared For: Eng. Tasneem Darwesh Darwesh University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Concurrent and Real Time programming ١٤٤٣/١٢/٥ 1 ebtesam saleh - chapter 12 - section 4
Transcript
Page 1: Monitoring Deadline Misses in Periodic Real-time Threads Prepared By: Ebtesam Saleh-220060051 Prepared For: Eng. Tasneem Darwesh University of Palestine.

Monitoring Deadline Monitoring Deadline Misses in Periodic Real-Misses in Periodic Real-

time Threadstime Threads

Prepared By: Ebtesam Saleh-220060051Prepared By: Ebtesam Saleh-220060051Prepared For: Eng. Tasneem DarweshPrepared For: Eng. Tasneem Darwesh

University of PalestineFaculty of Applied Engineering and Urban Planning

Software Engineering Department

Concurrent and Real Time programming

/ /١٤٤٤ ١٠ ١1 ebtesam saleh - chapter 12 - section 4

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

In many soft real-time systems applications will want to monitor any deadline misses, but take no action unless a certain threshold is reached.

/ /١٤٤٤ ١٠ ١2 ebtesam saleh - chapter 12 - section 4

Monitoring Deadline Misses : interface

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

/ /١٤٤٤ ١٠ ١ebtesam saleh - chapter 12 - section 43

ExampleExamplehealth monitor objechealth monitor objec

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

import javax.realtime.*; public class HealthMonitor { public void

persistentDeadlineMiss(Schedulable s); }

Monitoring Deadline Misses : interface

/ /١٤٤٤ ١٠ ١4 ebtesam saleh - chapter 12 - section 4

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

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; }

/ /١٤٤٤ ١٠ ١5 ebtesam saleh - chapter 12 - section 4

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

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; }

/ /١٤٤٤ ١٠ ١6 ebtesam saleh - chapter 12 - section 4

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

• 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

/ /١٤٤٤ ١٠ ١7 ebtesam saleh - chapter 12 - section 4

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

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

/ /١٤٤٤ ١٠ ١8 ebtesam saleh - chapter 12 - section 4

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

setting up the real-time periodic thread

/ /١٤٤٤ ١٠ ١9 ebtesam saleh - chapter 12 - section 4

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

setting up the real-time periodic thread

/ /١٤٤٤ ١٠ ١10 ebtesam saleh - chapter 12 - section 4

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

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

/ /١٤٤٤ ١٠ ١11 ebtesam saleh - chapter 12 - section 4

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

/ /١٤٤٤ ١٠ ١12 ebtesam saleh - chapter 12 - section 4

Questions??Questions??


Recommended