|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--javax.realtime.RealtimeThread | +--javax.realtime.NoHeapRealtimeThread
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 allocated or reference any object allocated
in the heap nor is it even allowed to manipulate any reference
to any 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 complatible 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 java.lang.Thread
(e.g., enumerate
and join) complete normally except where the 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
.
Field Summary |
Fields inherited from class javax.realtime.RealtimeThread |
checkDepth, currentScheduler, heapMemCount, mem, memAreaStack, memoryParameters, noHeap, original, processingGroupParameters, releaseParameters, RTJ_init_in_progress, schedulingParameters, topStack |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
NoHeapRealtimeThread(javax.realtime.MemoryArea area)
Construct a NoHeapRealtimeThread which will execute in the
given MemoryArea |
|
NoHeapRealtimeThread(javax.realtime.MemoryArea area,
java.lang.Runnable logic)
Construct a NoHeapRealtimeThread which will execute
logic in the given MemoryArea |
|
NoHeapRealtimeThread(javax.realtime.MemoryParameters mp,
java.lang.Runnable logic)
Construct a new NoHeapRealtimeThread that will inherit
the properties described in MemoryParameters and will
run logic . |
|
NoHeapRealtimeThread(javax.realtime.SchedulingParameters sp,
javax.realtime.MemoryArea ma)
Create a NoHeapRealtimeThread . |
|
NoHeapRealtimeThread(javax.realtime.SchedulingParameters scheduling,
javax.realtime.ReleaseParameters release)
Check to see if a write is possible to the given object. |
|
NoHeapRealtimeThread(javax.realtime.SchedulingParameters sp,
javax.realtime.ReleaseParameters rp,
javax.realtime.MemoryArea ma)
Create a NoHeapRealtimeThread . |
|
NoHeapRealtimeThread(javax.realtime.SchedulingParameters sp,
javax.realtime.ReleaseParameters rp,
javax.realtime.MemoryParameters mp,
javax.realtime.MemoryArea ma,
javax.realtime.ProcessingGroupParameters group,
java.lang.Runnable logic)
Create a NoHeapRealtimeThread . |
Method Summary | |
void |
checkNoHeapRead(java.lang.Object obj)
Check to see if a read is possible from the given object. |
void |
checkNoHeapWrite(java.lang.Object obj)
|
static void |
print(double d)
|
static void |
print(int n)
|
static void |
print(long l)
|
static void |
print(java.lang.String s)
A print method that's safe to call from a NoHeapRealtimeThread. |
private void |
setup(javax.realtime.MemoryArea area)
Setup some state for the constructors |
void |
start()
Checks if the NoHeapRealtimeThread is startable and starts
it if it is. |
java.lang.String |
toString()
Return a String describing this thread. |
Methods inherited from class java.lang.Thread |
checkAccess, countStackFrames, destroy, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, stop, stop, suspend |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NoHeapRealtimeThread(javax.realtime.SchedulingParameters sp, javax.realtime.MemoryArea ma) throws java.lang.IllegalArgumentException
NoHeapRealtimeThread
.
sp
- A SchedulingParameters
object that will be
associated with this
. A null value means
this will not have an associated
SchedulingParameters
object.ma
- A MemoryArea
object. Must be a
ScopedMemory
or ImmortalMemory
type. A null value causes an IllegalArgumentException
to be thrown.
- Throws:
java.lang.IllegalArgumentException
- If the memory area
parameter is null.
public NoHeapRealtimeThread(javax.realtime.SchedulingParameters sp, javax.realtime.ReleaseParameters rp, javax.realtime.MemoryArea ma) throws java.lang.IllegalArgumentException
NoHeapRealtimeThread
.
sp
- A SchedulingParameters
object that will be
associated with this
. A null value means
this will not have an associated
SchedulingParameters
object.rp
- A ReleaseParameters
object that will be
associated with this
. A null value means
this will not have an associated ReleaseParameters
object.ma
- A MemoryArea
object. Must be a
ScopedMemory
or ImmortalMemory
type. A null value causes an IllegalArgumentException
to be thrown.
- Throws:
java.lang.IllegalArgumentException
- If the memory area
parameter is null.
public NoHeapRealtimeThread(javax.realtime.SchedulingParameters sp, javax.realtime.ReleaseParameters rp, javax.realtime.MemoryParameters mp, javax.realtime.MemoryArea ma, javax.realtime.ProcessingGroupParameters group, java.lang.Runnable logic) throws java.lang.IllegalArgumentException
NoHeapRealtimeThread
.
sp
- A SchedulingParameters
object that will be
associated with this
. A null value means
this will not have an associated
SchedulingParameters
object.rp
- A ReleaseParameters
object that will be
associated with this
. A null value means
this will not have an associated ReleaseParameters
object.mp
- A MemoryParameters
object that will be
associated with this
. A null value means
this will not have a MemoryParameters
object.ma
- A MemoryArea
object. Must be a
ScopedMemory
or ImmortalMemory
type. A null value causes an IllegalArgumentException
to be thrown.group
- A ProcessingGroupParameters
object that will
be associated with this
A null value means this
will not have an associated ProcessingGroupParameters
object.logic
- A Runnable
whose run()
method will
be executed for this
.
- Throws:
java.lang.IllegalArgumentException
- If the memory area
parameter is null.
public NoHeapRealtimeThread(javax.realtime.MemoryArea area) throws java.lang.IllegalArgumentException
NoHeapRealtimeThread
which will execute in the
given MemoryArea
public NoHeapRealtimeThread(javax.realtime.MemoryArea area, java.lang.Runnable logic) throws java.lang.IllegalArgumentException
NoHeapRealtimeThread
which will execute
logic
in the given MemoryArea
public NoHeapRealtimeThread(javax.realtime.MemoryParameters mp, java.lang.Runnable logic)
NoHeapRealtimeThread
that will inherit
the properties described in MemoryParameters
and will
run logic
.
public NoHeapRealtimeThread(javax.realtime.SchedulingParameters scheduling, javax.realtime.ReleaseParameters release)
NoHeapRealtimeThreads
for real, because you can't access
the object at all in a real NoHeapRealtimeThread
.
Method Detail |
private void setup(javax.realtime.MemoryArea area) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void start()
NoHeapRealtimeThread
is startable and starts
it if it is. Checks that the parameters associated with this
NoHeapRealtimeThread
object are not allocated in heap. Also,
checks if this
object is allocated in heap. If any of them
are allocated, start()
throws a MemoryAccessError
.
start
in class RealtimeThread
MemoryAccessError
- If any of the parameters of this
is allocated on heap.public void checkNoHeapWrite(java.lang.Object obj)
checkNoHeapWrite
in class RealtimeThread
public void checkNoHeapRead(java.lang.Object obj)
NoHeapRealtimeThreads
for real, because you can't access
the object at all in a real NoHeapRealtimeThread
.
checkNoHeapRead
in class RealtimeThread
public java.lang.String toString()
toString
in class RealtimeThread
public static void print(java.lang.String s)
public static void print(double d)
public static void print(int n)
public static void print(long l)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |