abstract class BaseSpscLinkedArrayQueue<E> extends BaseSpscLinkedArrayQueueConsumerField<E> implements QueueProgressIndicators
Modifier and Type | Field and Description |
---|---|
private static long |
C_INDEX_OFFSET |
protected static java.lang.Object |
JUMP |
private static long |
P_INDEX_OFFSET |
consumerIndex
consumerBuffer, consumerMask
p0, p1, p10, p11, p12, p13, p14, p15, p16, p17, p2, p3, p4, p5, p6, p7
producerIndex
maxQueueCapacity, producerBuffer, producerLimit, producerLookAheadStep, producerMask
Constructor and Description |
---|
BaseSpscLinkedArrayQueue() |
Modifier and Type | Method and Description |
---|---|
long |
currentConsumerIndex()
This method has no concurrent visibility semantics.
|
long |
currentProducerIndex()
This method has no concurrent visibility semantics.
|
java.util.Iterator<E> |
iterator() |
protected long |
lvConsumerIndex() |
protected E[] |
lvNext(E[] curr) |
protected long |
lvProducerIndex() |
private E |
newBufferPeek(E[] buffer,
long index) |
private E |
newBufferPoll(E[] buffer,
long index) |
private long |
nextArrayOffset(E[] curr) |
boolean |
offer(E e) |
protected abstract 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
protected static final java.lang.Object JUMP
private static final long P_INDEX_OFFSET
private static final long C_INDEX_OFFSET
public int size()
protected void soProducerIndex(long v)
protected void soConsumerIndex(long v)
protected long lvProducerIndex()
protected long lvConsumerIndex()
public final java.util.Iterator<E> iterator()
public long currentProducerIndex()
QueueProgressIndicators
currentProducerIndex
in interface QueueProgressIndicators
public long currentConsumerIndex()
QueueProgressIndicators
currentConsumerIndex
in interface QueueProgressIndicators
private long nextArrayOffset(E[] curr)
public boolean offer(E e)
This implementation is correct for single producer thread use only.
offer
in interface java.util.Queue<E>
protected abstract boolean offerColdPath(E[] buffer, long mask, E e, long index, long offset)
public E poll()
This implementation is correct for single consumer thread use only.
poll
in interface java.util.Queue<E>
public E peek()
This implementation is correct for single consumer thread use only.
peek
in interface java.util.Queue<E>