public class MpscChunkedUnpaddedArrayQueue<E> extends MpscChunkedUnpaddedArrayQueueColdProducerFields<E>
MessagePassingQueue.Consumer<T>, MessagePassingQueue.ExitCondition, MessagePassingQueue.Supplier<T>, MessagePassingQueue.WaitStrategy
maxQueueCapacity
producerBuffer, producerMask
consumerBuffer, consumerMask
UNBOUNDED_CAPACITY
Constructor and Description |
---|
MpscChunkedUnpaddedArrayQueue(int maxCapacity) |
MpscChunkedUnpaddedArrayQueue(int initialCapacity,
int maxCapacity) |
Modifier and Type | Method and Description |
---|---|
protected long |
availableInQueue(long pIndex,
long cIndex) |
int |
capacity() |
protected long |
getCurrentBufferCapacity(long mask) |
protected int |
getNextBufferSize(E[] buffer) |
currentConsumerIndex, currentProducerIndex, drain, drain, drain, fill, fill, fill, isEmpty, iterator, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPoll, size, toString
casProducerLimit, lvProducerLimit, soProducerLimit
lpConsumerIndex, lvConsumerIndex, soConsumerIndex
casProducerIndex, lvProducerIndex, soProducerIndex
contains, containsAll, remove, removeAll, retainAll, toArray, toArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clear
public MpscChunkedUnpaddedArrayQueue(int maxCapacity)
public MpscChunkedUnpaddedArrayQueue(int initialCapacity, int maxCapacity)
initialCapacity
- the queue initial capacity. If chunk size is fixed this will be the chunk size.
Must be 2 or more.maxCapacity
- the maximum capacity will be rounded up to the closest power of 2 and will be the
upper limit of number of elements in this queue. Must be 4 or more and round up to a larger
power of 2 than initialCapacity.protected long availableInQueue(long pIndex, long cIndex)
availableInQueue
in class BaseMpscLinkedUnpaddedArrayQueue<E>
public int capacity()
capacity
in interface IndexedQueueSizeUtil.IndexedQueue
capacity
in interface MessagePassingQueue<E>
capacity
in class BaseMpscLinkedUnpaddedArrayQueue<E>
MessagePassingQueue.UNBOUNDED_CAPACITY
if not boundedprotected int getNextBufferSize(E[] buffer)
getNextBufferSize
in class BaseMpscLinkedUnpaddedArrayQueue<E>
protected long getCurrentBufferCapacity(long mask)
getCurrentBufferCapacity
in class BaseMpscLinkedUnpaddedArrayQueue<E>