javax.realtime
Class NoHeapRealtimeThread

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

public 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 RealtimeThread.run() is never allowed to allocate or reference any object allocated in the heap nor is it even allowed to manipulate any reference toany object in the heap. For example, if a and b are objects in immortal memory, b.p is reference to an object on the heap, and a.p is type compatible with b.p, then a NoHeapRealtimeThread is not allowed to execute anything like the following:

a.p = b.p; b.p = null;

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. 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.

Author:
Angelo Corsaro, Morgan Deters

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NoHeapRealtimeThread(SchedulingParameters schedulingParam, MemoryArea memoryArea)
          Creates a new NoHeapRealtimeThread instance with the given characteristics.
NoHeapRealtimeThread(SchedulingParameters schedulingParam, ReleaseParameters releaseParam, MemoryArea memoryArea)
          Creates a new NoHeapRealtimeThread instance with the given characteristics and a Runnable.
NoHeapRealtimeThread(SchedulingParameters schedulingParam, ReleaseParameters releaseParam, MemoryParameters memoryParam, MemoryArea memoryArea, ProcessingGroupParameters groupParam, Runnable logic)
          Creates a new NoHeapRealtimeThread instance with the given characteristics and a Runnable.
 
Method Summary
 void start()
          Performs several checks, then starts this NoHeapRealtimeThread if it is startable.
 
Methods inherited from class javax.realtime.RealtimeThread
addIfFeasible, addToFeasibility, currentRealtimeThread, deschedulePeriodic, executionEligibility, getActiveMemoryArea, getCurrentMemoryArea, getInitialMemoryAreaIndex, getMemoryArea, getMemoryAreaStackDepth_, getMemoryAreaStackDepth, getMemoryParameters, getOuterMemoryArea, getProcessingGroupParameters, getReleaseParameters, getScheduler, getSchedulingParameters, interrupt, removeFromFeasibility, run, schedulePeriodic, setIfFeasible, setIfFeasible, setIfFeasible, setIfFeasible, setIfFeasible, setMemoryParameters, setMemoryParametersIfFeasible, setProcessingGroupParameters, setProcessingGroupParametersIfFeasible, setReleaseParameters, setReleaseParametersIfFeasible, setScheduler, setScheduler, setSchedulingParameters, setSchedulingParametersIfFeasible, setupTSS, sleep, sleep, sleep, sleep, sleep, sleep, 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
 

Constructor Detail

NoHeapRealtimeThread

public NoHeapRealtimeThread(SchedulingParameters schedulingParam,
                            MemoryArea memoryArea)
                     throws IllegalArgumentException
Creates a new NoHeapRealtimeThread instance with the given characteristics.

Parameters:
schedulingParam - The SchedulingParameters associated with this (and possibly other instances of NoHeapRealtimeThread).
memoryArea - The MemoryArea associated with this.

NoHeapRealtimeThread

public NoHeapRealtimeThread(SchedulingParameters schedulingParam,
                            ReleaseParameters releaseParam,
                            MemoryArea memoryArea)
                     throws IllegalArgumentException
Creates a new NoHeapRealtimeThread instance with the given characteristics and a Runnable.

Parameters:
schedulingParam - The SchedulingParameters associated with this (and possibly other instances of NoHeapRealtimeThread).
releaseParam - The ReleaseParameters associated with this (and possibly other instances of NoHeapRealtimeThread).
memoryArea - The MemoryArea associated with this.

NoHeapRealtimeThread

public NoHeapRealtimeThread(SchedulingParameters schedulingParam,
                            ReleaseParameters releaseParam,
                            MemoryParameters memoryParam,
                            MemoryArea memoryArea,
                            ProcessingGroupParameters groupParam,
                            Runnable logic)
                     throws IllegalArgumentException
Creates a new NoHeapRealtimeThread instance with the given characteristics and a Runnable.

Parameters:
schedulingParam - The SchedulingParameters associated with this (and possibly other instances of NoHeapRealtimeThread).
releaseParam - The ReleaseParameters associated with this (and possibly other instances of NoHeapRealtimeThread).
memoryParam - The MemoryParameters associated with this (and possibly other instances of NoHeapRealtimeThread).
memoryArea - The MemoryArea associated with this.
groupParam - -The ProcessingGroupParameters associated with this (and possibly other instances of NoHeapRealtimeThread).
logic - the logic for this thread.
Method Detail

start

public void start()
Performs several checks, then starts this NoHeapRealtimeThread if it is startable. No parameters or the NoHeapRealtimeThread object itself may be allocated from the heap.

Overrides:
start in class RealtimeThread
Throws:
MemoryAccessError - if any parameter or this is allocated in the heap, or if this thread was requested to run in the heap.


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2006 Angelo Corsaro and Morgan Deters.