public class SpscUnboundedAtomicArrayQueue<E> extends AbstractQueue<E> implements QueueProgressIndicators
| Modifier and Type | Field and Description |
|---|---|
protected AtomicReferenceArray<Object> |
consumerBuffer |
protected AtomicLong |
consumerIndex |
protected int |
consumerMask |
protected AtomicReferenceArray<Object> |
producerBuffer |
protected AtomicLong |
producerIndex |
protected long |
producerLookAhead |
protected int |
producerLookAheadStep |
protected int |
producerMask |
| Constructor and Description |
|---|
SpscUnboundedAtomicArrayQueue(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() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
int |
size() |
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 final AtomicLong producerIndex
protected int producerLookAheadStep
protected long producerLookAhead
protected int producerMask
protected AtomicReferenceArray<Object> producerBuffer
protected int consumerMask
protected AtomicReferenceArray<Object> consumerBuffer
protected final AtomicLong consumerIndex
public SpscUnboundedAtomicArrayQueue(int chunkSize)
public final Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollection<E>public final boolean offer(E e)
This implementation is correct for single producer thread use only.
public final E poll()
This implementation is correct for single consumer thread use only.
public final 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 long currentProducerIndex()
QueueProgressIndicatorscurrentProducerIndex in interface QueueProgressIndicatorspublic long currentConsumerIndex()
QueueProgressIndicatorscurrentConsumerIndex in interface QueueProgressIndicatorsCopyright © 2013–2016. All rights reserved.