public class SpscUnboundedArrayQueue<E> extends AbstractQueue<E> implements QueueProgressIndicators
| Modifier and Type | Field and Description |
|---|---|
protected E[] |
consumerBuffer
|
protected long |
consumerIndex
|
protected long |
consumerMask
|
protected E[] |
producerBuffer
|
protected long |
producerIndex
|
protected long |
producerLookAhead
|
protected int |
producerLookAheadStep
|
protected long |
producerMask
|
| Constructor and Description |
|---|
SpscUnboundedArrayQueue(int bufferSize)
|
| 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 |
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 long consumerIndex
protected long consumerMask
protected E[] consumerBuffer
protected int producerLookAheadStep
protected long producerLookAhead
protected long producerMask
protected E[] producerBuffer
protected long producerIndex
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()
public long currentProducerIndex()
QueueProgressIndicators
currentProducerIndex in interface
QueueProgressIndicators
public long currentConsumerIndex()
QueueProgressIndicators
currentConsumerIndex in interface
QueueProgressIndicators