public class SpscUnboundedArrayQueue<E> extends AbstractQueue<E>
| Modifier and Type | Field and Description |
|---|---|
protected E[] |
consumerBuffer |
protected long |
consumerIndex |
protected long |
consumerMask |
protected static Object |
JUMP |
protected int |
maxQueueCapacity |
protected E[] |
producerBuffer |
protected long |
producerIndex |
protected long |
producerLimit |
protected int |
producerLookAheadStep |
protected long |
producerMask |
| Constructor and Description |
|---|
SpscUnboundedArrayQueue(int chunkSize) |
| Modifier and Type | Method and Description |
|---|---|
long |
currentConsumerIndex()
This method has no concurrent visibility semantics.
|
long |
currentProducerIndex()
This method has no concurrent visibility semantics.
|
Iterator<E> |
iterator() |
protected long |
lvConsumerIndex() |
protected E[] |
lvNext(E[] curr) |
protected long |
lvProducerIndex() |
boolean |
offer(E e) |
protected boolean |
offerColdPath(E[] buffer,
long mask,
E e,
long index,
long offset) |
E |
peek() |
E |
poll() |
int |
size() |
protected void |
soConsumerIndex(long v) |
protected void |
soNext(E[] curr,
E[] next) |
protected void |
soProducerIndex(long v) |
protected void |
writeToQueue(E[] buffer,
E e,
long index,
long offset) |
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayprotected static final Object JUMP
protected long consumerIndex
protected long consumerMask
protected E[] consumerBuffer
protected long producerIndex
protected int maxQueueCapacity
protected int producerLookAheadStep
protected long producerLimit
protected long producerMask
protected E[] producerBuffer
public int size()
size in interface Collection<E>size in class AbstractCollection<E>protected void soProducerIndex(long v)
protected void soConsumerIndex(long v)
protected long lvProducerIndex()
protected long lvConsumerIndex()
public final Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollection<E>public long currentProducerIndex()
QueueProgressIndicatorscurrentProducerIndex in interface QueueProgressIndicatorspublic long currentConsumerIndex()
QueueProgressIndicatorscurrentConsumerIndex in interface QueueProgressIndicatorsprotected final void soNext(E[] curr,
E[] next)
protected final E[] lvNext(E[] curr)
public boolean offer(E e)
This implementation is correct for single producer thread use only.
protected final void writeToQueue(E[] buffer,
E e,
long index,
long offset)
public E poll()
This implementation is correct for single consumer thread use only.
Copyright © 2013–2016. All rights reserved.