public class WaitFreeDequeue extends Object
Jamaica Real-Time Specification for Java class WaitFreeDequeue.
This class permits a thread to read from and write to one other threads without being blocked. This is required in RTSJ implementations that do not have real-time garbage collection to permit communication between NoHeapRealtimeThreads and normal Threads or RealtimeThreads to avoid the potential priority inversion problem of the NoHeapRealtimeThread being blocked waiting for another thread that itself if blocked by garbage collection activity.
In the JamaicaVM implementation, a thread that does not perform memory allocation is never blocked by the garbage collector unless it was preempted by a higher priority thread that performs memory allocation. In conjunction with the priority inversion avoidance mechanisms provided for monitors in the RTSJ (priority inheritance and priority ceiling emulation), this priority-inversion situation cannot occur in JamaicaVM, and normal protection using monitors is sufficient for the communication between NoHeapRealtimeThreads and normal Java threads. This class is consequently provided only for compatibility with other RTSJ implementations that do not provide real-time garbage collection.
Constructor and Description |
---|
WaitFreeDequeue(Runnable writer,
Runnable reader,
int maximum,
MemoryArea memory)
Deprecated.
RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use
WaitFreeRead/ WriteQueue instead.
|
Modifier and Type | Method and Description |
---|---|
Object |
blockingRead()
Deprecated.
RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use
WaitFreeRead/ WriteQueue instead.
|
void |
blockingWrite(Object object)
Deprecated.
RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use
WaitFreeRead/ WriteQueue instead.
|
boolean |
force(Object object)
Deprecated.
RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use
WaitFreeRead/ WriteQueue instead.
|
Object |
nonBlockingRead()
Deprecated.
RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use
WaitFreeRead/ WriteQueue instead.
|
boolean |
nonBlockingWrite(Object object)
Deprecated.
RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use
WaitFreeRead/ WriteQueue instead.
|
public WaitFreeDequeue(Runnable writer, Runnable reader, int maximum, MemoryArea memory) throws IllegalArgumentException, MemoryScopeException
IllegalArgumentException
- if maximum <= 0 or writer or
read are not referring to a Thread or a Schedulable object.MemoryScopeException
- if writer or reads is non-null and
in a memory area that is not assignment compatible with memory.writer
- A thread or schedulable object that may write to
this queue or nullreader
- A thread or schedulable object that may read from
this queue or null.maximum
- capacity of this queuememory
- The memory area in which internal elements are
allocated, or null.public Object nonBlockingRead()
public void blockingWrite(Object object) throws InterruptedException
InterruptedException
object
- The object to be put in the queue.public boolean nonBlockingWrite(Object object)
object
- The object to be put in the queue.public Object blockingRead() throws InterruptedException
InterruptedException
public boolean force(Object object) throws MemoryScopeException
MemoryScopeException
object
- The object to be put in the queue.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2019 aicas GmbH. All Rights Reserved.