E - public final class MpscArrayQueue<E> extends ConcurrentCircularArrayQueue<E>
ConcurrentCircularArrayQueue. This implies that any thread
may call the offer method, but only a single thread may call poll/peek for correctness to maintained. buffer, BUFFER_PAD, capacity, mask, SPARSE_SHIFT| Constructor and Description |
|---|
MpscArrayQueue(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
casProducerIndex(long expect,
long newValue) |
boolean |
isEmpty() |
protected long |
lvConsumerIndex() |
protected long |
lvConsumerIndexCache() |
protected long |
lvProducerIndex() |
boolean |
offer(E e)
IMPLEMENTATION NOTES: Lock free offer using a single CAS. |
E |
peek() |
E |
poll() |
int |
size() |
protected void |
soConsumerIndex(long l) |
protected void |
svConsumerIndexCache(long v) |
int |
weakOffer(E e)
A wait free alternative to offer which fails on CAS failure.
|
calcElementOffset, clear, iterator, lpElement, lpElement, lvElement, lvElement, soElement, soElement, spElement, spElementadd, addAll, element, removecontains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraypublic boolean offer(E e)
Queue.offer(java.lang.Object),
MessagePassingQueue.offer(Object)public int weakOffer(E e)
e - new element, not nullpublic E poll()
IMPLEMENTATION NOTES:
Lock free poll using ordered loads/stores. As class name suggests access is limited to a single thread.
Queue.poll(),
MessagePassingQueue.poll()public E peek()
IMPLEMENTATION NOTES:
Lock free peek using ordered loads. As class name suggests access is limited to a single thread.
Queue.poll(),
MessagePassingQueue.poll()public int size()
size in interface Collection<E>size in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in class AbstractCollection<E>protected final long lvConsumerIndex()
protected void soConsumerIndex(long l)
protected final long lvConsumerIndexCache()
protected final void svConsumerIndexCache(long v)
protected final long lvProducerIndex()
protected final boolean casProducerIndex(long expect,
long newValue)
Copyright © 2013–2014. All rights reserved.