E - public class MpscGrowableAtomicArrayQueue<E> extends MpscChunkedAtomicArrayQueue<E> implements MessagePassingQueue<E>, QueueProgressIndicators
MessagePassingQueue.Consumer<T>, MessagePassingQueue.ExitCondition, MessagePassingQueue.Supplier<T>, MessagePassingQueue.WaitStrategy| Modifier and Type | Field and Description |
|---|---|
protected AtomicReferenceArray<E> |
consumerBuffer |
protected AtomicLong |
consumerIndex |
protected long |
consumerMask |
protected long |
maxQueueCapacity |
protected AtomicReferenceArray<E> |
producerBuffer |
protected AtomicLong |
producerIndex |
protected AtomicLong |
producerLimit |
protected long |
producerMask |
UNBOUNDED_CAPACITY| Constructor and Description |
|---|
MpscGrowableAtomicArrayQueue(int maxCapacity) |
MpscGrowableAtomicArrayQueue(int initialCapacity,
int maxCapacity) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
getCurrentBufferCapacity(long mask) |
protected int |
getNextBufferSize(AtomicReferenceArray<E> buffer) |
availableInQueue, capacitycurrentConsumerIndex, currentProducerIndex, drain, drain, drain, fill, fill, fill, isEmpty, iterator, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPoll, size, toStringcontains, containsAll, remove, removeAll, retainAll, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcapacity, clear, drain, drain, drain, fill, fill, fill, isEmpty, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPoll, sizecurrentConsumerIndex, currentProducerIndexcontains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayprotected final long maxQueueCapacity
protected volatile AtomicLong producerLimit
protected long producerMask
protected AtomicReferenceArray<E> producerBuffer
protected long consumerMask
protected AtomicReferenceArray<E> consumerBuffer
protected AtomicLong consumerIndex
protected AtomicLong producerIndex
public MpscGrowableAtomicArrayQueue(int maxCapacity)
public MpscGrowableAtomicArrayQueue(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 int getNextBufferSize(AtomicReferenceArray<E> buffer)
getNextBufferSize in class MpscChunkedAtomicArrayQueue<E>protected long getCurrentBufferCapacity(long mask)
getCurrentBufferCapacity in class MpscChunkedAtomicArrayQueue<E>Copyright © 2013–2017. All rights reserved.