Package com.illumon.util.queue
Class SynchronizedLinkedConcurrentQueue<T>
java.lang.Object
com.illumon.util.queue.SynchronizedLinkedConcurrentQueue<T>
- All Implemented Interfaces:
ConcurrentQueue<T>
Unconstrained low-allocation queue, implemented via intrusive linked list.
All access is synchronized.
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptiondequeue()Returns null when the queue is empty This method should never block (but it may spin for a finite amount of time)booleanReturns false when the queue is full This method should never block (but it may spin for a finite amount of time)booleanSpins forever until the item can be enqueued.peek()Return the current next value, or null if the queue is empty.voidOnly return when enqueued.take()Only return w/ a dequeued value.
-
Constructor Details
-
SynchronizedLinkedConcurrentQueue
-
-
Method Details
-
enqueue
Description copied from interface:ConcurrentQueueReturns false when the queue is full This method should never block (but it may spin for a finite amount of time)- Specified by:
enqueuein interfaceConcurrentQueue<T>
-
enqueue
Description copied from interface:ConcurrentQueueSpins forever until the item can be enqueued. Calls yield() after the number of specified spins.- Specified by:
enqueuein interfaceConcurrentQueue<T>
-
dequeue
Description copied from interface:ConcurrentQueueReturns null when the queue is empty This method should never block (but it may spin for a finite amount of time)- Specified by:
dequeuein interfaceConcurrentQueue<T>
-
put
Description copied from interface:ConcurrentQueueOnly return when enqueued. (Might spin continuously)- Specified by:
putin interfaceConcurrentQueue<T>
-
take
Description copied from interface:ConcurrentQueueOnly return w/ a dequeued value. (Might spin continuously)- Specified by:
takein interfaceConcurrentQueue<T>
-
peek
Description copied from interface:ConcurrentQueueReturn the current next value, or null if the queue is empty.- Specified by:
peekin interfaceConcurrentQueue<T>
-