javax.realtime
Class NoHeapRealtimeThread

java.lang.Object
  extended byjava.lang.Thread
      extended byjavax.realtime.RealtimeThread
          extended byjavax.realtime.NoHeapRealtimeThread
All Implemented Interfaces:
java.lang.Runnable, Schedulable

public abstract class NoHeapRealtimeThread
extends RealtimeThread

A NoHeapRealtimeThread is a specialized form of RealtimeThread. Because an instance of NoHeapRealtimeThread may immediately preempt any implemented garbage collector, logic contained in its run() is never allowed to allocate or reference any object allocated in the heap. At the byte-code level, it is illegal for a reference to an object allocated in heap to appear on a no-heap real-time thread's operand stack. Thus, it is always safe for a NoHeapRealtimeThread to interrupt the garbage collector at any time, without waiting for the end of the garbage collection cycle or a defined preemption point. Due to these restrictions, a NoHeapRealtimeThread 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 execution would cause access violations. The constructors of NoHeapRealtimeThread require a reference to ScopedMemory or ImmortalMemory.

When the thread is started, all execution occurs in the scope of the given memory area. Thus, all memory allocation performed with the new operator is taken from this given area.


Field Summary
 
Fields inherited from class javax.realtime.RealtimeThread
activePhaseToDo, currentEventNotice, currentPriority, defaultPriority, endTime, lastPriorityChangeNanos, lastWaitStart, logic, memoryArea, memoryParameters, processingGroup, releaseParameters, resourcesHeld, scheduler, scheduling, startAbsoluteMillis, started, startTime, terminated, timeWeightedPriority, waitingForResource, waitTime
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NoHeapRealtimeThread(SchedulingParameters scheduling, MemoryArea area)
          Create a NoHeapRealtimeThread.
NoHeapRealtimeThread(SchedulingParameters scheduling, ReleaseParameters release, MemoryArea area)
          Create a no-heap real-time thread with the given characteristics.
NoHeapRealtimeThread(SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, MemoryArea area, ProcessingGroupParameters group, java.lang.Runnable logic)
          Create a real-time thread with the given characteristics and a Runnable.
NoHeapRealtimeThread(java.lang.String name, SchedulingParameters scheduling, MemoryArea area)
          Constructor.
NoHeapRealtimeThread(java.lang.String name, SchedulingParameters scheduling, ReleaseParameters release, MemoryArea area)
          Constructor.
NoHeapRealtimeThread(java.lang.String name, SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, MemoryArea area, ProcessingGroupParameters group, java.lang.Runnable logic)
          Constructor.
 
Methods inherited from class javax.realtime.RealtimeThread
addToFeasibility, addToWaitTime, averagePriority, body, dynamicPriority, exit, getBasePriority, getLastWaitStart, getMemoryParameters, getProcessingGroupParameters, getReleaseParameters, getScheduler, getSchedulingParameters, initialize, isActive, notifyPriorityChange, printAllStatistics, printResourcesHeld, printStatistics, printTimes, removeFromFeasibility, run, setLastWaitStart, setMemoryParameters, setMemoryParametersIfFeasible, setProcessingGroupParameters, setProcessingGroupParametersIfFeasible, setReleaseParameters, setReleaseParametersIfFeasible, setScheduler, setScheduler, setSchedulingParameters, setSchedulingParametersIfFeasible, toString
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NoHeapRealtimeThread

public NoHeapRealtimeThread(java.lang.String name,
                            SchedulingParameters scheduling,
                            MemoryArea area)
Constructor.

Not currently implemented

Parameters:
name - The name of this NoHeapRealtimeThread
scheduling - The SchedulingParameters associated with this (and possibly other instances of Schedulable). If scheduling is null, the default is a copy of the creator's scheduling parameters created in the same memory area as the new NoHeapRealtimeThread.
area - The MemoryArea associated with this. If area is null, an IllegalArgumentException is thrown.
Throws:
java.lang.IllegalArgumentException - Thrown if the parameters are not compatible with the associated scheduler, if area is null, if area is heap memory, if area, release or scheduling is allocated in heap memory, or if this is in heap memory.
IllegalAssignmentError - Thrown if the new NoHeapRealtimeThread instance cannot hold a reference to non-null values of scheduling and release, or if those parameters cannot hold a reference to the new NoHeapRealtimeThread.

NoHeapRealtimeThread

public NoHeapRealtimeThread(SchedulingParameters scheduling,
                            MemoryArea area)
Create a NoHeapRealtimeThread. This constructor is equivalent to NoHeapRealtimeThread(scheduling, null, null, area, null, null).

Not currently implemented

Parameters:
scheduling - The SchedulingParameters associated with this (and possibly other instances of Schedulable). If scheduling is null, the default is a copy of the creator's scheduling parameters created in the same memory area as the new NoHeapRealtimeThread.
area - The MemoryArea associated with this. If area is null, an IllegalArgumentException is thrown.
Throws:
java.lang.IllegalArgumentException - Thrown if the parameters are not compatible with the associated scheduler, if area is null, if area is heap memory, if area or scheduling is allocated in heap memory, or if this is in heap memory.
IllegalAssignmentError - Thrown if the new NoHeapRealtimeThread instance cannot hold a reference to scheduling or area, or if either parameter cannot hold a reference to the new NoHeapRealtimeThread.

NoHeapRealtimeThread

public NoHeapRealtimeThread(SchedulingParameters scheduling,
                            ReleaseParameters release,
                            MemoryArea area)
Create a no-heap real-time thread with the given characteristics. This constructor is equivalent to NoHeapRealtimeThread(scheduling, release, null, area, null, null).

Not currently implemented

Parameters:
scheduling - The SchedulingParameters associated with this (and possibly other instances of Schedulable). If scheduling is null, the default is a copy of the creator's scheduling parameters created in the same memory area as the new NoHeapRealtimeThread.
release - The ReleaseParameters associated with this (and possibly other instances of Schedulable). If release is null the it defaults to the a copy of the creator's release parameters created in the same memory area as the new NoHeapRealtimeThread.
area - The MemoryArea associated with this. If area is null, an IllegalArgumentException is thrown.
Throws:
java.lang.IllegalArgumentException - Thrown if the parameters are not compatible with the associated scheduler, if area is null, if area is heap memory, if area, release or scheduling is allocated in heap memory, or if this is in heap memory.
IllegalAssignmentError - Thrown if the new NoHeapRealtimeThread instance cannot hold a reference to non-null values of scheduling and release, or if those parameters cannot hold a reference to the new NoHeapRealtimeThread.

NoHeapRealtimeThread

public NoHeapRealtimeThread(java.lang.String name,
                            SchedulingParameters scheduling,
                            ReleaseParameters release,
                            MemoryArea area)
Constructor.

Not currently implemented

Parameters:
name - The name of this NoHeapRealtimeThread
scheduling - The SchedulingParameters associated with this (and possibly other instances of Schedulable). If scheduling is null, the default is a copy of the creator's scheduling parameters created in the same memory area as the new NoHeapRealtimeThread.
release - The ReleaseParameters associated with this (and possibly other instances of Schedulable). If release is null the it defaults to the a copy of the creator's release parameters created in the same memory area as the new NoHeapRealtimeThread.
area - The MemoryArea associated with this. If area is null, an IllegalArgumentException is thrown.
Throws:
java.lang.IllegalArgumentException - Thrown if the parameters are not compatible with the associated scheduler, if area is null, if area is heap memory, if area, scheduling or release is allocated in heap memory, or if this is in heap memory.
IllegalAssignmentError - Thrown if the new NoHeapRealtimeThread instance cannot hold references to non-null values of scheduling, release, memory and group, or if those parameters cannot hold a reference to the new NoHeapRealtimeThread.

NoHeapRealtimeThread

public NoHeapRealtimeThread(SchedulingParameters scheduling,
                            ReleaseParameters release,
                            MemoryParameters memory,
                            MemoryArea area,
                            ProcessingGroupParameters group,
                            java.lang.Runnable logic)
Create a real-time thread with the given characteristics and a Runnable. The thread group of the new thread is (effectively) null.

The newly-created no-heap real-time thread is associated with the scheduler in effect during execution of the constructor.

Not currently implemented

Parameters:
scheduling - The SchedulingParameters associated with this (and possibly other instances of Schedulable). If scheduling is null, the default is a copy of the creator's scheduling parameters created in the same memory area as the new NoHeapRealtimeThread.
release - The ReleaseParameters associated with this (and possibly other instances of Schedulable). If release is null the it defaults to the a copy of the creator's release parameters created in the same memory area as the new NoHeapRealtimeThread.
memory - The MemoryParameters associated with this (and possibly other instances of Schedulable). If memory is null, the new NoHeapRealtimeThread will have a null value for its memory parameters, and the amount or rate of memory allocation is unrestricted.
area - The MemoryArea associated with this. If area is null, an IllegalArgumentException is thrown.
group - The ProcessingGroupParameters associated with this (and possibly other instances of Schedulable). If null, the new NoHeapRealtimeThread will not be associated with any processing group.
logic - The Runnable object whose run() method will serve as the logic for the new NoHeapRealtimeThread. If logic is null, the run() method in the new object will serve as its logic.
Throws:
java.lang.IllegalArgumentException - Thrown if the parameters are not compatible with the associated scheduler, if area is null, if area is heap memory, if area, scheduling, release, memory or group is allocated in heap memory, if this is in heap memory, or if logic is in heap memory.
IllegalAssignmentError - Thrown if the new NoHeapRealtimeThread instance cannot hold references to non-null values of scheduling, release, memory and group, or if those parameters cannot hold a reference to the new NoHeapRealtimeThread.

NoHeapRealtimeThread

public NoHeapRealtimeThread(java.lang.String name,
                            SchedulingParameters scheduling,
                            ReleaseParameters release,
                            MemoryParameters memory,
                            MemoryArea area,
                            ProcessingGroupParameters group,
                            java.lang.Runnable logic)
Constructor.

Not currently implemented

Parameters:
name - The name of this NoHeapRealtimeThread
scheduling - The SchedulingParameters associated with this (and possibly other instances of Schedulable). If scheduling is null, the default is a copy of the creator's scheduling parameters created in the same memory area as the new NoHeapRealtimeThread.
release - The ReleaseParameters associated with this (and possibly other instances of Schedulable). If release is null the it defaults to the a copy of the creator's release parameters created in the same memory area as the new NoHeapRealtimeThread.
memory - The MemoryParameters associated with this (and possibly other instances of Schedulable). If memory is null, the new NoHeapRealtimeThread will have a null value for its memory parameters, and the amount or rate of memory allocation is unrestricted.
area - The MemoryArea associated with this. If area is null, an IllegalArgumentException is thrown.
group - The ProcessingGroupParameters associated with this (and possibly other instances of Schedulable). If null, the new NoHeapRealtimeThread will not be associated with any processing group.
logic - The Runnable object whose run() method will serve as the logic for the new NoHeapRealtimeThread. If logic is null, the run() method in the new object will serve as its logic.
Throws:
java.lang.IllegalArgumentException - Thrown if the parameters are not compatible with the associated scheduler, if area is null, if area is heap memory, if area, scheduling, release, memory or group is allocated in heap memory, if this is in heap memory, or if logic is in heap memory.
IllegalAssignmentError - Thrown if the new NoHeapRealtimeThread instance cannot hold references to non-null values of scheduling, release, memory and group, or if those parameters cannot hold a reference to the new NoHeapRealtimeThread.