See:
Description
Packages | |
---|---|
javax.realtime |
This section describes the two real-time thread classes. These classes:
java.lang.Thread.
The RealtimeThread
class extends
java.lang.Thread
. The ReleaseParameters, SchedulingParameters,
and MemoryParameters
objects passed to the RealtimeThread
constructor allow the temporal
and processor demands of the thread to be communicated to the scheduler.
The NoHeapRealtimeThread
class extends
RealtimeThread
. A NoHeapRealtimeThread
is not
allowed to allocate or even reference objects from the Java heap, and can thus
safely execute in preference to the garbage collector.
The RTSJ provides two types of objects which implement the Schedulable interface: real-time threads and asynchronous event handlers. This chapter defines the facilities that are available to real-time threads. In many cases these facilities are also available to asynchronous event handlers. In particular:
AsynchronouslyInterruptedException
is pending.
This attribute is set when a call to RealtimeThread.interrupt() is made on the associated real-time thread, and when an asynchronously interrupted exception's fire
method is invoked between the time the real-time thread has entered that exception's doInterruptible
method, and return from doInterruptible
. (See the Asynchrony chapter.)
waitForNextPeriodInterruptible
methods are for use by real-time threads that have periodic release parameters. In the absence of any deadline miss or cost overrun (or an interrupt in the case of waitForNextPeriodInterruptible
) the methods return when the real-time thread's next period is due.RealtimeThread
that are created in scoped memory
and instances of NoHeapRealtimeThread
do not have conventional
references to thread groups nor do thread groups have conventional references
to these threads. For the purposes of this version of the specification those
references are null
.uncaughtException
method in ThreadGroup
:
ThreadDeath
the thread
simply terminatesSystem.err
before it terminates. The Java platform's priority-preemptive dispatching model is very similar to
the dispatching model found in the majority of commercial real-time operating
systems. However, the dispatching semantics were purposefully relaxed
in order to allow execution on a wide variety of operating systems. Thus,
it is appropriate to specify real-time threads by extending java.lang.Thread
.
The ReleaseParameters
and MemoryParameters
provided
to the RealtimeThread
constructor allow for a number of common
real-time thread types, including periodic threads.
The
NoHeapRealtimeThread
class is provided in order to allow
time-critical threads to execute in preference to the garbage collector given
appropriate assignment of execution eligibility. The memory access and
assignment semantics of the NoHeapRealtimeThread
are designed to
guarantee that the execution of such threads does not lead to an inconsistent
heap state.