| Modifier and Type | Field and Description |
|---|---|
| pack-priv AtomicReferenceArray | |
| pack-priv final AtomicLong | |
| pack-priv final int | |
| private static final Object | |
| pack-priv static final int | |
| pack-priv AtomicReferenceArray | |
| pack-priv final AtomicLong | |
| pack-priv long | |
| pack-priv int | |
| pack-priv final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private static int | |
| private static int | |
| public void | clear()
Implements io. |
| public boolean | isEmpty()
Implements io. |
| private long | |
| private long | |
| private long | |
| private static <E> Object | |
| private AtomicReferenceArray | |
| private long | |
| private T | |
| private T | |
| public boolean | offer(final T
the value to enqueue, not null e)Implements io. |
| public boolean | Returns: true if the queue accepted the two new valuesthe first value, not null first, T the second value, not null second)Implements io. |
| public T | |
| public T | poll()
Implements io. |
| private void | resize(final AtomicReferenceArray<Object> oldBuffer, final long currIndex, final int offset, final T e, final long mask)
|
| public int | |
| private void | |
| private static void | |
| private void | |
| private void | |
| private boolean | writeToQueue(final AtomicReferenceArray<Object> buffer, final T e, final long index, final int offset)
|
| consumerBuffer | back to summary |
|---|---|
| pack-priv AtomicReferenceArray<Object> consumerBuffer | |
| consumerIndex | back to summary |
|---|---|
| pack-priv final AtomicLong consumerIndex | |
| consumerMask | back to summary |
|---|---|
| pack-priv final int consumerMask | |
| HAS_NEXT | back to summary |
|---|---|
| private static final Object HAS_NEXT | |
| MAX_LOOK_AHEAD_STEP | back to summary |
|---|---|
| pack-priv static final int MAX_LOOK_AHEAD_STEP | |
| producerBuffer | back to summary |
|---|---|
| pack-priv AtomicReferenceArray<Object> producerBuffer | |
| producerIndex | back to summary |
|---|---|
| pack-priv final AtomicLong producerIndex | |
| producerLookAhead | back to summary |
|---|---|
| pack-priv long producerLookAhead | |
| producerLookAheadStep | back to summary |
|---|---|
| pack-priv int producerLookAheadStep | |
| producerMask | back to summary |
|---|---|
| pack-priv final int producerMask | |
| SpscLinkedArrayQueue | back to summary |
|---|---|
| public SpscLinkedArrayQueue(final int bufferSize) | |
| adjustLookAheadStep | back to summary |
|---|---|
| private void adjustLookAheadStep(int capacity) | |
| calcDirectOffset | back to summary |
|---|---|
| private static int calcDirectOffset(int index) | |
| calcWrappedOffset | back to summary |
|---|---|
| private static int calcWrappedOffset(long index, int mask) | |
| clear | back to summary |
|---|---|
| public void clear() Implements io. Doc from io. Removes all enqueued items from this queue.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements io. Doc from io. Returns true if the queue is empty.
Note however that due to potential fused functions in
| |
| lpConsumerIndex | back to summary |
|---|---|
| private long lpConsumerIndex() | |
| lpProducerIndex | back to summary |
|---|---|
| private long lpProducerIndex() | |
| lvConsumerIndex | back to summary |
|---|---|
| private long lvConsumerIndex() | |
| lvElement | back to summary |
|---|---|
| private static <E> Object lvElement(AtomicReferenceArray<Object> buffer, int offset) | |
| lvNextBufferAndUnlink | back to summary |
|---|---|
private AtomicReferenceArray
| |
| lvProducerIndex | back to summary |
|---|---|
| private long lvProducerIndex() | |
| newBufferPeek | back to summary |
|---|---|
private T newBufferPeek(AtomicReferenceArray<Object> nextBuffer, final long index, final int mask)
| |
| newBufferPoll | back to summary |
|---|---|
private T newBufferPoll(AtomicReferenceArray<Object> nextBuffer, final long index, final int mask)
| |
| offer | back to summary |
|---|---|
| public boolean offer(final T e) Implements io. Doc from io. Atomically enqueue a single. This implementation is correct for single producer thread use only.
| |
| offer | back to summary |
|---|---|
| public boolean offer(T first, T second) Implements io. Offer two elements at the same time. Don't use the regular offer() with this at all!
| |
| peek | back to summary |
|---|---|
public T peek()
| |
| poll | back to summary |
|---|---|
| public T poll() Implements io. Doc from io. Tries to dequeue a value (non-null) or returns null if the queue is empty.
If the producer uses This implementation is correct for single consumer thread use only.
| |
| resize | back to summary |
|---|---|
| private void resize(final AtomicReferenceArray<Object> oldBuffer, final long currIndex, final int offset, final T e, final long mask) | |
| size | back to summary |
|---|---|
| public int size() | |
| soConsumerIndex | back to summary |
|---|---|
| private void soConsumerIndex(long v) | |
| soElement | back to summary |
|---|---|
| private static void soElement(AtomicReferenceArray<Object> buffer, int offset, Object e) | |
| soNext | back to summary |
|---|---|
| private void soNext(AtomicReferenceArray<Object> curr, AtomicReferenceArray<Object> next) | |
| soProducerIndex | back to summary |
|---|---|
| private void soProducerIndex(long v) | |
| writeToQueue | back to summary |
|---|---|
| private boolean writeToQueue(final AtomicReferenceArray<Object> buffer, final T e, final long index, final int offset) | |