aicas logoJamaica 6.4 release 1

javax.realtime
Class WaitFreeDequeue

java.lang.Object
  extended by javax.realtime.WaitFreeDequeue

Deprecated. RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use WaitFreeRead/WriteQueue instead.

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 Summary
WaitFreeDequeue(Runnable writer, Runnable reader, int maximum, MemoryArea memory)
          Deprecated. RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use WaitFreeRead/ WriteQueue instead.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaitFreeDequeue

public WaitFreeDequeue(Runnable writer,
                       Runnable reader,
                       int maximum,
                       MemoryArea memory)
                throws IllegalArgumentException,
                       MemoryScopeException
Deprecated. RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use WaitFreeRead/ WriteQueue instead.

Constructor to construct a non-blocking dequeue in given memory area.

Parameters:
writer - A thread or schedulable object that may write to this queue or null
reader - A thread or schedulable object that may read from this queue or null.
maximum - capacity of this queue
memory - The memory area in which internal elements are allocated, or null.
Throws:
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.
Method Detail

nonBlockingRead

public Object nonBlockingRead()
Deprecated. RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use WaitFreeRead/ WriteQueue instead.

nonBlockingRead reads the oldest element from the queue.

Returns:
the read element, or null if the queue is empty.

blockingWrite

public void blockingWrite(Object object)
Deprecated. RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use WaitFreeRead/ WriteQueue instead.

blockingWrite writes an element to the queue. This routine synchronizes and blocks if the queue is full to wait until an element has been removed such that the write can proceed.

Parameters:
object - The object to be put in the queue.
Since:
RTSJ V1.0.1 return type changed to void, the old return value was always true.

nonBlockingWrite

public boolean nonBlockingWrite(Object object)
Deprecated. RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use WaitFreeRead/ WriteQueue instead.

nonBlockingWrite writes an element to the queue. If the queue is full, the element will not be written to the queue. If the queue is empty and any other thread is blocked doing a read() on this queue, the highest priority waiting thread will be unblocked to read this element.

Parameters:
object - The object to be put in the queue.

blockingRead

public Object blockingRead()
Deprecated. RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use WaitFreeRead/ WriteQueue instead.

blockingRead reads one element from the queue. If the queue is empty, this call blocks until an element is written to the queue that can be read.

Returns:
the read element.

force

public boolean force(Object object)
              throws MemoryScopeException
Deprecated. RTSJ V1.0.1 class WaitFreeDequeue is deprecated. Use WaitFreeRead/ WriteQueue instead.

force writes object into the queue even if the queue is full. If the queue is not full, this is equivalent to write(). If the queue is full, this will try to replace the last entry.

Parameters:
object - The object to be put in the queue.
Returns:
true if the last element was overwritten, false if this performed a normal write that did not overwrite any other element.
Throws:
MemoryScopeException

aicas logoJamaica 6.4 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2015 aicas GmbH. All Rights Reserved.