E - IndexedQueueSizeUtil.IndexedQueue, MessagePassingQueue<E>, QueueProgressIndicatorsMpscGrowableAtomicArrayQueuepublic class MpscChunkedAtomicArrayQueue<E> extends BaseMpscLinkedAtomicArrayQueue<E>
MessagePassingQueue.Consumer<T>, MessagePassingQueue.ExitCondition, MessagePassingQueue.Supplier<T>, MessagePassingQueue.WaitStrategy| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.concurrent.atomic.AtomicReferenceArray<E> |
consumerBuffer |
|
protected long |
consumerIndex |
|
protected long |
consumerMask |
|
protected long |
maxQueueCapacity |
|
protected java.util.concurrent.atomic.AtomicReferenceArray<E> |
producerBuffer |
|
protected long |
producerIndex |
|
protected long |
producerLimit |
|
protected long |
producerMask |
UNBOUNDED_CAPACITY| Constructor | Description |
|---|---|
MpscChunkedAtomicArrayQueue(int maxCapacity) |
|
MpscChunkedAtomicArrayQueue(int initialCapacity,
int maxCapacity) |
| Modifier and Type | Method | Description |
|---|---|---|
protected long |
availableInQueue(long pIndex,
long cIndex) |
|
int |
capacity() |
|
protected long |
getCurrentBufferCapacity(long mask) |
|
protected int |
getNextBufferSize(java.util.concurrent.atomic.AtomicReferenceArray<E> buffer) |
|
long |
lvConsumerIndex() |
|
long |
lvProducerIndex() |
contains, containsAll, remove, removeAll, retainAll, toArray, toArraycurrentConsumerIndex, currentProducerIndex, drain, drain, drain, fill, fill, fill, isEmpty, iterator, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPoll, size, toStringcontains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayclearprotected final long maxQueueCapacity
protected volatile long producerLimit
protected long producerMask
protected java.util.concurrent.atomic.AtomicReferenceArray<E> producerBuffer
protected long consumerMask
protected java.util.concurrent.atomic.AtomicReferenceArray<E> consumerBuffer
protected volatile long consumerIndex
protected volatile long producerIndex
public MpscChunkedAtomicArrayQueue(int maxCapacity)
public MpscChunkedAtomicArrayQueue(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 BaseMpscLinkedAtomicArrayQueue<E>public int capacity()
capacity in interface MessagePassingQueue<E>capacity in class BaseMpscLinkedAtomicArrayQueue<E>MessagePassingQueue.UNBOUNDED_CAPACITY if not boundedprotected int getNextBufferSize(java.util.concurrent.atomic.AtomicReferenceArray<E> buffer)
getNextBufferSize in class BaseMpscLinkedAtomicArrayQueue<E>protected long getCurrentBufferCapacity(long mask)
getCurrentBufferCapacity in class BaseMpscLinkedAtomicArrayQueue<E>public final long lvConsumerIndex()
public final long lvProducerIndex()
Copyright © 2013–2017. All rights reserved.