public class SpscChunkedArrayQueue<E> extends AbstractQueue<E>
| Modifier and Type | Field and Description |
|---|---|
protected E[] |
consumerBuffer |
protected long |
consumerIndex |
protected long |
consumerMask |
protected static Object |
JUMP |
protected E[] |
producerBuffer |
protected long |
producerBufferLimit |
protected long |
producerIndex |
protected long |
producerMask |
| Constructor and Description |
|---|
SpscChunkedArrayQueue(int capacity) |
SpscChunkedArrayQueue(int chunkSize,
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.
|
boolean |
isEmpty() |
Iterator<E> |
iterator() |
protected void |
linkOldToNew(long currIndex,
E[] oldBuffer,
long offset,
E[] newBuffer,
long offsetInNew,
E e) |
long |
lvConsumerIndex() |
protected E[] |
lvNextArrayAndUnlink(E[] curr) |
long |
lvProducerIndex() |
boolean |
offer(E e) |
protected boolean |
offerColdPath(E[] buffer,
long mask,
E e,
long pIndex,
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) |
String |
toString() |
protected void |
writeToQueue(E[] buffer,
E e,
long index,
long offset) |
contains, containsAll, remove, removeAll, retainAll, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayprotected static final Object JUMP
protected long producerBufferLimit
protected long producerMask
protected E[] producerBuffer
protected long producerIndex
protected long consumerIndex
protected long consumerMask
protected E[] consumerBuffer
public SpscChunkedArrayQueue(int capacity)
public SpscChunkedArrayQueue(int chunkSize,
int capacity)
protected final boolean offerColdPath(E[] buffer, long mask, E e, long pIndex, long offset)
protected final void soProducerIndex(long v)
protected final void soConsumerIndex(long v)
public final long lvProducerIndex()
lvProducerIndex in interface IndexedQueueSizeUtil.IndexedQueuepublic final long lvConsumerIndex()
lvConsumerIndex in interface IndexedQueueSizeUtil.IndexedQueuepublic final Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollection<E>public String toString()
toString 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[] lvNextArrayAndUnlink(E[] curr)
public boolean offer(E e)
This implementation is correct for single producer thread use only.
protected final void linkOldToNew(long currIndex,
E[] oldBuffer,
long offset,
E[] newBuffer,
long offsetInNew,
E e)
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.
public E peek()
This implementation is correct for single consumer thread use only.
public final int size()
size in interface Collection<E>size in class AbstractCollection<E>public final boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in class AbstractCollection<E>Copyright © 2013–2017. All rights reserved.