|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--util.AdaptiveThreadManager
A AdaptiveThreadManager controls a pool of AdaptivePeriodicThread objects and automatically adjusts the
period of the threads until the threads are feasible in the system.
If it is not possible to have all the threads running at one time,
running precidence is based on registration order. If threads are
waiting on system resources, when a thread finishes, systems
resources will be distributed based on registration order to the
threads waiting.
AdaptivePeriodicThread| Field Summary | |
private Set |
activeThreads
The set of threads that are currently running. |
private static boolean |
debug
Flag for turning debug output off and on |
private static double |
PERIOD_ADJUST_PERC
The percentage of the difference between the current period and maximum period of a thread that reallocateResources(AdaptivePeriodicThread)
will try to increase if resources are required. |
private static util.AdaptiveThreadManager |
singleton
The singleton instance of this class. |
private LinkedList |
waitingThreads
The set of threads waiting for system resources. |
| Constructor Summary | |
private |
AdaptiveThreadManager()
|
| Method Summary | |
private void |
debug(String s)
Emits a debug message if debug is enabled. |
static util.AdaptiveThreadManager |
instance()
|
private boolean |
reallocateResources(util.AdaptivePeriodicThread thread)
Adjusts the period of the new thread or, if necessary, the periods of currently active threads to free resources for the new thread, and returns whether the thread is feasible after the adjustments, if any, were made. |
(package private) void |
registerShutdown(util.AdaptivePeriodicThread thread)
|
(package private) void |
registerThread(util.AdaptivePeriodicThread thread)
Starts this thread immediately if either the resources for feasible execution are immediately available, or current resources can be adjusted to allow for this threads execution. |
private void |
startReallocationThread()
Attempts to redistribute resources to waiting threads when a currently running thread finishes its execution. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static util.AdaptiveThreadManager singleton
private final LinkedList waitingThreads
private static final double PERIOD_ADJUST_PERC
reallocateResources(AdaptivePeriodicThread)
will try to increase if resources are required.
private final Set activeThreads
private static final boolean debug
| Constructor Detail |
private AdaptiveThreadManager()
| Method Detail |
public static util.AdaptiveThreadManager instance()
private void debug(String s)
private boolean reallocateResources(util.AdaptivePeriodicThread thread)
AdaptivePeriodicThread.getMaximumPeriod().
void registerThread(util.AdaptivePeriodicThread thread)
void registerShutdown(util.AdaptivePeriodicThread thread)
private void startReallocationThread()
registerShutdown(AdaptivePeriodicThread)
|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||