public class SpscGrowableArrayQueue<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 |
---|
SpscGrowableArrayQueue(int capacity) |
SpscGrowableArrayQueue(int initialCapacity,
int capacity) |
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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
protected 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 SpscGrowableArrayQueue(int capacity)
public SpscGrowableArrayQueue(int initialCapacity, int capacity)
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()
QueueProgressIndicators
currentProducerIndex
in interface QueueProgressIndicators
public long currentConsumerIndex()
QueueProgressIndicators
currentConsumerIndex
in interface QueueProgressIndicators
protected 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.