|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
javax.realtime.RealtimeThread
RealtimeThread extends Thread and
includes classes and methods to get and set parameter objects,
manage the execution of those threads with a ReleaseParameters type of PeriodicParameters , and
waiting. A RealtimeThread object must be placed in a
memory area such that thread logic may unexceptionally access
instance variables and such that Java methods on Thread (e.g., enumerate and join) complete normally
except where such execution would cause access violations.
Parameters for constructors may be null . In such cases the default
value will be the default value set for the particular type by the
associated instance of Scheduler.
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
RealtimeThread()
Creates a new RealtimeThread instance. |
|
RealtimeThread(Runnable logic)
Deprecated. off-spec |
|
RealtimeThread(SchedulingParameters scheduling)
Creates a new RealtimeThread instance with given SchedulingParameters. |
|
RealtimeThread(SchedulingParameters scheduling,
ReleaseParameters release)
Creates a new RealtimeThread instance with given SchedulingParameters and ReleaseParameters. |
|
RealtimeThread(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
Runnable logic)
Creates a new RealtimeThread instance with the given
characteristics and a Runnable. |
|
| Method Summary | |
boolean |
addIfFeasible()
Add to the feasibility of the already set scheduler if the resulting feasibility set is schedulable. |
boolean |
addToFeasibility()
Inform the scheduler and cooperating facilities that the resource demands (as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters) of this instance of Schedulable will be considered in the feasibility analysis of the associated Scheduler until further notice. |
static RealtimeThread |
currentRealtimeThread()
Gets the currently running RealtimeThread. |
void |
deschedulePeriodic()
Stop unblocking waitForNextPeriod() for a
periodic schedulable object. |
int |
executionEligibility()
|
MemoryArea |
getActiveMemoryArea()
|
static MemoryArea |
getCurrentMemoryArea()
Return the instance of MemoryArea which is the current
memory area for this. |
static int |
getInitialMemoryAreaIndex()
Memory area stacks include inherited stacks from parent threads. |
MemoryArea |
getMemoryArea()
Get the initial memory area for this RealtimeThread
(corresponding to the MemoryArea constructor argument);
if this RealtimeThread was constructed with a
null MemoryArea argument, this method returns a
reference to the allocation context that was active when this
RealtimeThread was constructed. |
int |
getMemoryAreaStackDepth_()
|
static int |
getMemoryAreaStackDepth()
Get the size of the stack of MemoryArea instances to which
this RealtimeThread has access. |
MemoryParameters |
getMemoryParameters()
Get the MemoryParameters of this schedulable object. |
static MemoryArea |
getOuterMemoryArea(int index)
Get the instance of MemoryArea in the memory area stack at
the index given. |
ProcessingGroupParameters |
getProcessingGroupParameters()
Get the ProcessingGroupParameters of this
schedulable object. |
ReleaseParameters |
getReleaseParameters()
Get the ReleaseParameters of this schedulable object. |
Scheduler |
getScheduler()
Get the Scheduler for this schedulable object. |
SchedulingParameters |
getSchedulingParameters()
Get the SchedulingParameters for this schedulable object. |
void |
interrupt()
Asynchronously interrupts this RealtimeThread with an
AsynchronouslyInterruptedException, or, if this RealtimeThread is not in an interruptible context, sets up an
AsynchronouslyInterruptedException to interrupt it when
it enters an interruptible context. |
boolean |
removeFromFeasibility()
Inform the scheduler and cooperating facilities that the resource demands, as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters, of
this instance of Schedulable should no longer be
considered in the feasibility analysis of the associated Scheduler. |
void |
run()
|
void |
schedulePeriodic()
Begin unblocking waitForNextPeriod() for a
periodic thread. |
boolean |
setIfFeasible(ReleaseParameters release,
MemoryParameters memory)
Returns true if, after considering the values of the parameters, the task set would still be feasible. |
boolean |
setIfFeasible(ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
Returns true if, after considering the values of the parameters, the task set would still be feasible. |
boolean |
setIfFeasible(ReleaseParameters release,
ProcessingGroupParameters group)
Returns true if, after considering the values of the parameters, the task set would still be feasible. |
boolean |
setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory)
|
boolean |
setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
|
void |
setMemoryParameters(MemoryParameters memory)
Set the MemoryParameters for this schedulable object. |
boolean |
setMemoryParametersIfFeasible(MemoryParameters memory)
Returns true if, after considering the value of the parameter, the task set would still be feasible. |
void |
setProcessingGroupParameters(ProcessingGroupParameters group)
Set the ProcessingGroupParameters for this schedulable object. |
boolean |
setProcessingGroupParametersIfFeasible(ProcessingGroupParameters group)
Set the ProcessingGroupParameters of this schedulable object
only if the resulting task set is feasible. |
void |
setReleaseParameters(ReleaseParameters release)
Set the ReleaseParametersfor this Schedulable object. |
boolean |
setReleaseParametersIfFeasible(ReleaseParameters release)
Returns true if, after considering the value of the parameter, the task set would still be feasible. |
void |
setScheduler(Scheduler scheduler)
Set the Scheduler for this schedulable object. |
void |
setScheduler(Scheduler scheduler,
SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
Set the Scheduler for this schedulable object. |
void |
setSchedulingParameters(SchedulingParameters scheduling)
Set the SchedulingParameters for this schedulable
object only if the resulting task set is feasible. |
boolean |
setSchedulingParametersIfFeasible(SchedulingParameters scheduling)
Set the SchedulingParameters for this schedulable object. |
void |
setupTSS()
|
static void |
sleep(AbsoluteTime time)
An accurate timer with nanosecond granularity. |
static void |
sleep(Clock clock,
AbsoluteTime time)
An accurate timer with nanosecond granularity. |
static void |
sleep(Clock clock,
HighResolutionTime time)
Deprecated. use the approriate method (i.e. the one that has either RelativeTime or AbsoluteTime). |
static void |
sleep(Clock clock,
RelativeTime time)
An accurate timer with nanosecond granularity. |
static void |
sleep(HighResolutionTime time)
An accurate timer with nanosecond granularity. |
static void |
sleep(RelativeTime time)
An accurate timer with nanosecond granularity. |
void |
start()
Checks if the instance of RealtimeThread is startable and starts it if it is. |
static boolean |
waitForNextPeriod()
Used by threads that have a reference to a ReleaseParameters type of PeriodicParameters to block
until the start of each period. |
static void |
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 |
| Constructor Detail |
public RealtimeThread()
RealtimeThread instance. All parameter
values are null.
public RealtimeThread(SchedulingParameters scheduling)
RealtimeThread instance with given SchedulingParameters.
scheduling - the SchedulingParameters associated
with this (and possibly other instances of RealtimeThread).
public RealtimeThread(SchedulingParameters scheduling,
ReleaseParameters release)
RealtimeThread instance with given SchedulingParameters and ReleaseParameters.
scheduling - the SchedulingParameters associated
with this (and possibly other instances of RealtimeThread)release - the ReleaseParameters associated with
this (and possibly other instances of RealtimeThread)
public RealtimeThread(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
Runnable logic)
RealtimeThread instance with the given
characteristics and a Runnable.
scheduling - the SchedulingParameters associated
with this (and possibly other instances of RealtimeThread).release - the ReleaseParameters associated with
this (and possibly other instances of RealtimeThread)memory - the MemoryParameters associated with
this (and possibly other instances of RealtimeThread)area - the MemoryArea associated with
thisgroup - the ProcessingGroupParameters associated
with this (and possibly other instances of RealtimeThread)logic - the logic for this thread.public RealtimeThread(Runnable logic)
RealtimeThread instance. All
parameter values are null, but the logic.
logic - a Runnable representing the thread logic.| Method Detail |
public static RealtimeThread currentRealtimeThread()
RealtimeThread.
RealtimeThread value representing the
thread the is running now.
ClassCastException - the current running thread is not a
real-time threadpublic boolean addIfFeasible()
addIfFeasible in interface Schedulable
public boolean setIfFeasible(ReleaseParameters release,
MemoryParameters memory)
setIfFeasible in interface Schedulablerelease - a ReleaseParameters valuememory - a MemoryParameters value
public boolean setIfFeasible(ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
setIfFeasible in interface Schedulablerelease - a ReleaseParameters valuememory - a MemoryParameters valuegroup - a ProcessingGroupParameters value
public boolean setIfFeasible(ReleaseParameters release,
ProcessingGroupParameters group)
setIfFeasible in interface Schedulablerelease - a ReleaseParameters valuegroup - a ProcessingGroupParameters value
public boolean setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory)
setIfFeasible in interface Schedulable
public boolean setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
setIfFeasible in interface Schedulablepublic void schedulePeriodic()
waitForNextPeriod() for a
periodic thread. Typically used when a periodic schedulable
object is in an overrun condition. The scheduler should
recompute the schedule and perform admission control. If this
does not have a type of PeriodicParameters as it ReleaseParameters nothing happens.
public void deschedulePeriodic()
waitForNextPeriod() for a
periodic schedulable object. If this does not have a type of
PeriodicParameters as it ReleaseParameters
nothing happens.
public static MemoryArea getCurrentMemoryArea()
MemoryArea which is the current
memory area for this.
MemoryArea valuepublic static int getInitialMemoryAreaIndex()
RealtimeThread is the memory area given as a
parameter to the constructor. This method returns the position
in the memory area stack of that initial memory area.
RealtimeThreadpublic static int getMemoryAreaStackDepth()
MemoryArea instances to which
this RealtimeThread has access.
MemoryArea instances.public static MemoryArea getOuterMemoryArea(int index)
MemoryArea in the memory area stack at
the index given. If the given index does not exist in the
memory area scope stack then null is returned.
index - The offset into the memory area stack.
MemoryArea at index or null if the
given value is does not correspond to a position in the stack.public MemoryArea getMemoryArea()
RealtimeThread
(corresponding to the MemoryArea constructor argument);
if this RealtimeThread was constructed with a
null MemoryArea argument, this method returns a
reference to the allocation context that was active when this
RealtimeThread was constructed.
RealtimeThread.public void interrupt()
RealtimeThread with an
AsynchronouslyInterruptedException, or, if this RealtimeThread is not in an interruptible context, sets up an
AsynchronouslyInterruptedException to interrupt it when
it enters an interruptible context.
The semantics of Thread.interrupt() are preserved.
public boolean addToFeasibility()
addToFeasibility in interface Schedulablepublic MemoryParameters getMemoryParameters()
MemoryParameters of this schedulable object.
getMemoryParameters in interface SchedulableMemoryParameters value.public void setMemoryParameters(MemoryParameters memory)
MemoryParameters for this schedulable object.
setMemoryParameters in interface Schedulablememory - the MemoryParameters for this
schedulable object.public boolean setMemoryParametersIfFeasible(MemoryParameters memory)
setMemoryParametersIfFeasible in interface Schedulablememory - the MemoryParameters for this
schedulable object.
public ProcessingGroupParameters getProcessingGroupParameters()
ProcessingGroupParameters of this
schedulable object.
getProcessingGroupParameters in interface SchedulableProcessingGroupParameters valuepublic void setProcessingGroupParameters(ProcessingGroupParameters group)
ProcessingGroupParameters for this schedulable object.
setProcessingGroupParameters in interface Schedulablegroup - a ProcessingGroupParameters valuepublic boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters group)
ProcessingGroupParameters of this schedulable object
only if the resulting task set is feasible.
setProcessingGroupParametersIfFeasible in interface Schedulablegroup - a ProcessingGroupParameters value
public ReleaseParameters getReleaseParameters()
ReleaseParameters of this schedulable object.
getReleaseParameters in interface SchedulableReleaseParameters valuepublic void setReleaseParameters(ReleaseParameters release)
ReleaseParametersfor this Schedulable object.
setReleaseParameters in interface Schedulablerelease - a ReleaseParameters valuepublic boolean setReleaseParametersIfFeasible(ReleaseParameters release)
setReleaseParametersIfFeasible in interface Schedulablerelease - a ReleaseParameters valuepublic Scheduler getScheduler()
Scheduler for this schedulable object.
getScheduler in interface SchedulableScheduler valuepublic void setScheduler(Scheduler scheduler)
Scheduler for this schedulable object.
setScheduler in interface Schedulablescheduler - the scheduler.
IllegalThreadStateException
public void setScheduler(Scheduler scheduler,
SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
Scheduler for this schedulable object.
setScheduler in interface Schedulablescheduler - a Scheduler valuescheduling - a SchedulingParameters valuerelease - a ReleaseParameters valuememory - a MemoryParameters valuegroup - a ProcessingGroupParameters value
IllegalThreadStateException - if an error occurspublic SchedulingParameters getSchedulingParameters()
SchedulingParameters for this schedulable object.
getSchedulingParameters in interface SchedulableSchedulingParameters valuepublic void setSchedulingParameters(SchedulingParameters scheduling)
SchedulingParameters for this schedulable
object only if the resulting task set is feasible.
setSchedulingParameters in interface Schedulablescheduling - a SchedulingParameters valuepublic boolean setSchedulingParametersIfFeasible(SchedulingParameters scheduling)
SchedulingParameters for this schedulable object.
setSchedulingParametersIfFeasible in interface Schedulablescheduling - a SchedulingParameters value
public boolean removeFromFeasibility()
SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters, of
this instance of Schedulable should no longer be
considered in the feasibility analysis of the associated Scheduler. Whether the resulting system is feasible or not,
the subtraction is completed.
removeFromFeasibility in interface Schedulable
public static void sleep(Clock clock,
HighResolutionTime time)
throws InterruptedException
RelativeTime or AbsoluteTime).
Clock. The
sleep time may be relative or absolute. If relative, then the
calling thread is blocked for the amount of time given by the
parameter. If absolute, then the calling thread is blocked
until the indicated point in time. If the given absolute time
is before the current time, the call to sleep returns
immediately.
Implementor Note: This method is ugly since it allows
the application writer to pass a RationalTime, which
does not make sense in this case.
clock - a Clock valuetime - a HighResolutionTime value
InterruptedException
public static void sleep(Clock clock,
RelativeTime time)
throws InterruptedException
Clock. The
sleep time may be relative or absolute. If relative, then the
calling thread is blocked for the amount of time given by the
parameter. If absolute, then the calling thread is blocked
until the indicated point in time. If the given absolute time
is before the current time, the call to sleep returns
immediately.
clock - a Clock valuetime - a RelativeTime value
InterruptedException
public static void sleep(Clock clock,
AbsoluteTime time)
throws InterruptedException
Clock. The
sleep time may be relative or absolute. If relative, then the
calling thread is blocked for the amount of time given by the
parameter. If absolute, then the calling thread is blocked
until the indicated point in time. If the given absolute time
is before the current time, the call to sleep returns
immediately.
clock - a Clock valuetime - a AbsoluteTime value
InterruptedException
public static void sleep(RelativeTime time)
throws InterruptedException
Clock. The
calling thread is blocked for the amount of time given by the
parameter.
time - a RelativeTime value
InterruptedException
public static void sleep(AbsoluteTime time)
throws InterruptedException
Clock. The
calling thread is blocked until the indicated point in time. If
the given absolute time is before the current time, the call to
sleep returns immediately.
time - an AbsoluteTime value
InterruptedException
public static void sleep(HighResolutionTime time)
throws InterruptedException
Clock. The
sleep time may be relative or absolute. If relative, then the
calling thread is blocked for the amount of time given by the
parameter. If absolute, then the calling thread is blocked
until the indicated point in time. If the given absolute time
is before the current time, the call to sleep returns
immediately.
time - a HighResolutionTime value
InterruptedExceptionpublic void start()
public void run()
run in interface Runnablepublic static boolean waitForNextPeriod()
ReleaseParameters type of PeriodicParameters to block
until the start of each period. Periods start at either the
start time in PeriodicParameters or when this.start() is called. This method will block until
the start of the next period unless the thread is in either an
overrun or deadline miss condition. If both overrun and miss
handlers are null and the thread has overrun its cost or missed
a deadline, this method will immediately return false
once per overrun or deadline miss. It will then again block
until the start of the next period (unless, of course, the
thread has overrun or missed again). If either the overrun or
deadline miss handlers are not null and the thread is in either
an overrun or deadline miss condition, this method will block
until the handler corrects the situation (possibly by calling
schedulePeriodic()).
boolean value as described above
IllegalThreadStateException - this does not
have a reference to a ReleaseParameters type of PeriodicParameterspublic void setupTSS()
public MemoryArea getActiveMemoryArea()
public int getMemoryAreaStackDepth_()
public int executionEligibility()
public static void yield()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||