The Wait-Free Write Queue

Objects in this class pass a queue of data from a no-heap thread to a heap-using thread. Its write method never blocks for garbage collection or boosts garbage collection at the consumer end of the queue into the no-heap range.

Methods

public java.lang.Object read( )

This read method will block if the queue is empty. It removes one entry from the head of the queue and returns it to the caller.

public boolean write(java.lang.Object object) throws
               MemoryScopeException

This write method cannot block. With an ordinary queue, a thread that tried to add an object to a full queue would block until there was room in the queue for the object. If you wanted to avoid waiting in the write, you would first check the queue to ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.