public class MpscUnboundedUnpaddedArrayQueue<E> extends BaseMpscLinkedUnpaddedArrayQueue<E>
MessagePassingQueue.Consumer<T>, MessagePassingQueue.ExitCondition, MessagePassingQueue.Supplier<T>, MessagePassingQueue.WaitStrategyproducerBuffer, producerMaskconsumerBuffer, consumerMaskUNBOUNDED_CAPACITY| Constructor and Description |
|---|
MpscUnboundedUnpaddedArrayQueue(int chunkSize) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
availableInQueue(long pIndex,
long cIndex) |
int |
capacity() |
int |
drain(MessagePassingQueue.Consumer<E> c)
Remove all available item from the queue and hand to consume.
|
int |
fill(MessagePassingQueue.Supplier<E> s)
Stuff the queue with elements from the supplier.
|
protected long |
getCurrentBufferCapacity(long mask) |
protected int |
getNextBufferSize(E[] buffer) |
currentConsumerIndex, currentProducerIndex, drain, drain, fill, fill, isEmpty, iterator, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPoll, size, toStringcasProducerLimit, lvProducerLimit, soProducerLimitlpConsumerIndex, lvConsumerIndex, soConsumerIndexcasProducerIndex, lvProducerIndex, soProducerIndexcontains, containsAll, remove, removeAll, retainAll, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclearpublic MpscUnboundedUnpaddedArrayQueue(int chunkSize)
protected long availableInQueue(long pIndex,
long cIndex)
availableInQueue in class BaseMpscLinkedUnpaddedArrayQueue<E>public int capacity()
capacity in interface IndexedQueueSizeUtil.IndexedQueuecapacity in interface MessagePassingQueue<E>capacity in class BaseMpscLinkedUnpaddedArrayQueue<E>MessagePassingQueue.UNBOUNDED_CAPACITY if not boundedpublic int drain(MessagePassingQueue.Consumer<E> c)
MessagePassingQueue
M m;
while((m = relaxedPoll()) != null){
c.accept(m);
}
There's no strong commitment to the queue being empty at the end of a drain. Called from a
consumer thread subject to the restrictions appropriate to the implementation.
WARNING: Explicit assumptions are made with regards to MessagePassingQueue.Consumer.accept(T) make sure you have read
and understood these before using this method.
drain in interface MessagePassingQueue<E>drain in class BaseMpscLinkedUnpaddedArrayQueue<E>public int fill(MessagePassingQueue.Supplier<E> s)
MessagePassingQueuewhile(relaxedOffer(s.get());There's no strong commitment to the queue being full at the end of a fill. Called from a producer thread subject to the restrictions appropriate to the implementation.
Unbounded queues will fill up the queue with a fixed amount rather than fill up to oblivion.
WARNING: Explicit assumptions are made with regards to MessagePassingQueue.Supplier.get() make sure you have read
and understood these before using this method.
fill in interface MessagePassingQueue<E>fill in class BaseMpscLinkedUnpaddedArrayQueue<E>protected int getNextBufferSize(E[] buffer)
getNextBufferSize in class BaseMpscLinkedUnpaddedArrayQueue<E>protected long getCurrentBufferCapacity(long mask)
getCurrentBufferCapacity in class BaseMpscLinkedUnpaddedArrayQueue<E>