E - IndexedQueueSizeUtil.IndexedQueue, MessagePassingQueue<E>, QueueProgressIndicatorspublic class MpscUnboundedAtomicArrayQueue<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 java.util.concurrent.atomic.AtomicReferenceArray<E> |
producerBuffer |
|
protected long |
producerIndex |
|
protected long |
producerLimit |
|
protected long |
producerMask |
UNBOUNDED_CAPACITY| Constructor | Description |
|---|---|
MpscUnboundedAtomicArrayQueue(int chunkSize) |
| Modifier and Type | Method | 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(java.util.concurrent.atomic.AtomicReferenceArray<E> buffer) |
|
long |
lvConsumerIndex() |
|
long |
lvProducerIndex() |
contains, containsAll, remove, removeAll, retainAll, toArray, toArraycurrentConsumerIndex, currentProducerIndex, drain, drain, fill, fill, isEmpty, iterator, offer, peek, poll, relaxedOffer, relaxedPeek, relaxedPoll, size, toStringcontains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayclearprotected 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 MpscUnboundedAtomicArrayQueue(int chunkSize)
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 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.drain in interface MessagePassingQueue<E>drain in class BaseMpscLinkedAtomicArrayQueue<E>public int fill(MessagePassingQueue.Supplier<E> s)
MessagePassingQueue
while(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.fill in interface MessagePassingQueue<E>fill in class BaseMpscLinkedAtomicArrayQueue<E>protected 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.