Boeing Simulation 3.1 API Specification

util
Class AdaptivePeriodicThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javax.realtime.RealtimeThread
              |
              +--util.RTWorkerThread
                    |
                    +--util.AdaptivePeriodicThread
All Implemented Interfaces:
Ceaseable, Runnable, Schedulable

public class AdaptivePeriodicThread
extends RTWorkerThread

An adapter class for RealtimeThread that allow for easier period adjustment.

All AdaptivePeriodicThread objects are automatically registered to the AdaptiveThreadManager. The method call AdaptiveThreadManager.registerThread(AdaptivePeriodicThread) attempts to incorporate this thread into the feasibility scheduling for the system. Since the method only returns when this thread is feasible, it is guaranteed execution time for the remained for its lifetime. Note that these runtime issues should prohibit designers from using this class for system critical threads that need start execution right away. Also note that this means that the constructor will block until enough resources are free to guarantee execution of this thread.

Version:
$Revision: 1.1 $
Author:
Dave Jurgens
See Also:
RTWorkerThread, AdaptiveThreadManager

Nested Class Summary
 
Nested classes inherited from class util.RTWorkerThread
RTWorkerThread.OverrunHandler
 
Field Summary
static boolean AUTO_CORRECT_FEASIBILITY
          Flag indicating that the PeriodicParameters defined for this Thread be continuously be adjusted until it is feasible for its execution in the system.
private  long maximumPeriod
          The time in millisecond that denotes the maximum period that this thread should be allowed to have.
private  long minimumPeriod
          The time in millisecond that denotes the minimum period that this thread should be allowed to have.
private static boolean SHOW_ADJUSTMENTS
          Debug flag for showing adjustments in the period and the feasibility thereof.
 
Fields inherited from class util.RTWorkerThread
cost, DEFAULT_OVERRUN_LOGIC, feasible, logic, overrunLogic, period
 
Fields inherited from class javax.realtime.RealtimeThread
deadlineMissHandler, eligibilityParam, groupParam, hasMissedDeadline, hasMissHandlers, hasOverrun, hasStarted, hasStartedTimer, isPeriodic, memoryParam, missCondition, overrunHandler, periodExpired, pipeID_, releaseParam, scheduler, schedulingParam, scopeStack, timeoutHandler_, waitingForNextPeriod
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AdaptivePeriodicThread(Runnable logic, long cost, long fixedPeriod)
          Constructs an AdaptivePeriodicThread with the minimumPeriod equal to the maximumPeriod, which allows for no adjustment in period timing.
AdaptivePeriodicThread(Runnable logic, long cost, long minimumPeriod, long maximumPeriod)
           
AdaptivePeriodicThread(Runnable logic, long cost, long minimumPeriod, long maximumPeriod, Runnable overrunLogic)
           
AdaptivePeriodicThread(Runnable logic, long cost, long fixedPeriod, Runnable overrunLogic)
          Constructs an AdaptivePeriodicThread with the minimumPeriod equal to the maximumPeriod, which allows for no adjustment in period timing.
 
Method Summary
(package private)  boolean adjustPeriod(long adjustedPeriod)
          Adjusts the ReleaseParameters if the thread if the resulting adjustment is still feasible given the system resources and returns true if it is still feasible.
 long getMaximumPeriod()
          Returns time in millisecond for maximum allowable period that this thread can have.
 void run()
           
 
Methods inherited from class util.RTWorkerThread
cease, getPeriod, isFeasible
 
Methods inherited from class javax.realtime.RealtimeThread
addIfFeasible, addToFeasibility, currentRealtimeThread, deschedulePeriodic, executionEligibility, getActiveMemoryArea, getCurrentMemoryArea, getInitialMemoryAreaIndex_, getInitialMemoryAreaIndex, getMemoryAreaStackDepth_, getMemoryAreaStackDepth, getMemoryParameters, getOuterMemoryArea_, getOuterMemoryArea, getProcessingGroupParameters, getReleaseParameters, getScheduler, getSchedulingParameters, getScopeStack, interrupt, removeFromFeasibility, rtfini_, schedulePeriodic, setIfFeasible, setIfFeasible, setIfFeasible, setMemoryParameters, setMemoryParametersIfFeasible, setProcessingGroupParameters, setProcessingGroupParametersIfFeasible, setReleaseParameters, setReleaseParametersIfFeasible, setScheduler, setScheduler, setSchedulingParameters, setSchedulingParametersIfFeasible, setTopMemoryArea, setupTimeoutHandler, setupTSS, sleep, sleep, sleep, sleep, sleep, sleep, start, updatePeriodicParameters, validateSchedulingParameters, waitForNextPeriod, yield
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.Ceaseable
join
 

Field Detail

AUTO_CORRECT_FEASIBILITY

public static final boolean AUTO_CORRECT_FEASIBILITY
Flag indicating that the PeriodicParameters defined for this Thread be continuously be adjusted until it is feasible for its execution in the system.

See Also:
Constant Field Values

minimumPeriod

private final long minimumPeriod
The time in millisecond that denotes the minimum period that this thread should be allowed to have.


maximumPeriod

private final long maximumPeriod
The time in millisecond that denotes the maximum period that this thread should be allowed to have.


SHOW_ADJUSTMENTS

private static final boolean SHOW_ADJUSTMENTS
Debug flag for showing adjustments in the period and the feasibility thereof.

See Also:
Constant Field Values
Constructor Detail

AdaptivePeriodicThread

public AdaptivePeriodicThread(Runnable logic,
                              long cost,
                              long fixedPeriod)
Constructs an AdaptivePeriodicThread with the minimumPeriod equal to the maximumPeriod, which allows for no adjustment in period timing.


AdaptivePeriodicThread

public AdaptivePeriodicThread(Runnable logic,
                              long cost,
                              long fixedPeriod,
                              Runnable overrunLogic)
Constructs an AdaptivePeriodicThread with the minimumPeriod equal to the maximumPeriod, which allows for no adjustment in period timing.


AdaptivePeriodicThread

public AdaptivePeriodicThread(Runnable logic,
                              long cost,
                              long minimumPeriod,
                              long maximumPeriod)

AdaptivePeriodicThread

public AdaptivePeriodicThread(Runnable logic,
                              long cost,
                              long minimumPeriod,
                              long maximumPeriod,
                              Runnable overrunLogic)
Method Detail

adjustPeriod

boolean adjustPeriod(long adjustedPeriod)

Adjusts the ReleaseParameters if the thread if the resulting adjustment is still feasible given the system resources and returns true if it is still feasible.

This method was made package protected so that the AdaptiveThreadManager can access it but classes outside this package cannot.


getMaximumPeriod

public long getMaximumPeriod()
Returns time in millisecond for maximum allowable period that this thread can have.


run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class RTWorkerThread

Boeing Simulation 3.1 API Specification

To submit a bug or feature email the author of that class. Funding for this research was provided by Boeing and DARPA.