E
- public final class SpscArrayQueue<E> extends ConcurrentCircularArrayQueue<E>
Modifier and Type | Field and Description |
---|---|
protected long |
consumerIndex |
protected int |
lookAheadStep |
protected long |
producerIndex |
protected long |
producerLookAhead |
buffer, BUFFER_PAD, capacity, mask, SPARSE_SHIFT
Constructor and Description |
---|
SpscArrayQueue(int capacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
isEmpty()
This method's accuracy is subject to concurrent modifications happening as the observation is carried out.
|
protected long |
lvConsumerIndex() |
protected long |
lvProducerIndex() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
int |
size() |
calcElementOffset, iterator, lpElement, lpElement, lvElement, lvElement, soElement, soElement, spElement, spElement
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
protected long consumerIndex
protected long producerIndex
protected long producerLookAhead
protected final int lookAheadStep
public boolean offer(E e)
This implementation is correct for single producer thread use only.
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 int size()
protected final long lvConsumerIndex()
protected final long lvProducerIndex()
public boolean isEmpty()