Package rx.internal.util.unsafe
Class SpmcArrayQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
rx.internal.util.unsafe.ConcurrentCircularArrayQueueL0Pad<E>
rx.internal.util.unsafe.ConcurrentCircularArrayQueue<E>
rx.internal.util.unsafe.SpmcArrayQueueL1Pad<E>
rx.internal.util.unsafe.SpmcArrayQueueProducerField<E>
rx.internal.util.unsafe.SpmcArrayQueueL2Pad<E>
rx.internal.util.unsafe.SpmcArrayQueueConsumerField<E>
rx.internal.util.unsafe.SpmcArrayQueueMidPad<E>
rx.internal.util.unsafe.SpmcArrayQueueProducerIndexCacheField<E>
rx.internal.util.unsafe.SpmcArrayQueueL3Pad<E>
rx.internal.util.unsafe.SpmcArrayQueue<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Queue<E>,MessagePassingQueue<E>
-
Field Summary
Fields inherited from class rx.internal.util.unsafe.SpmcArrayQueueL3Pad
p30, p31, p32, p33, p34, p35, p36, p37, p40, p41, p42, p43, p44, p45, p46Fields inherited from class rx.internal.util.unsafe.SpmcArrayQueueMidPad
p20, p21, p22, p23, p24, p25, p26Fields inherited from class rx.internal.util.unsafe.SpmcArrayQueueConsumerField
C_INDEX_OFFSETFields inherited from class rx.internal.util.unsafe.SpmcArrayQueueProducerField
P_INDEX_OFFSETFields inherited from class rx.internal.util.unsafe.SpmcArrayQueueL1Pad
p10, p11, p12, p13, p14, p15, p16Fields inherited from class rx.internal.util.unsafe.ConcurrentCircularArrayQueue
buffer, BUFFER_PAD, mask, SPARSE_SHIFT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty()This method's accuracy is subject to concurrent modifications happening as the observation is carried out.booleanCalled from a producer thread subject to the restrictions appropriate to the implementation and according to theQueue.offer(Object)interface.peek()Called from the consumer thread subject to the restrictions appropriate to the implementation and according to theQueue.peek()interface.poll()Called from the consumer thread subject to the restrictions appropriate to the implementation and according to theQueue.poll()interface.intsize()This method's accuracy is subject to concurrent modifications happening as the size is estimated and as such is a best effort rather than absolute value.Methods inherited from class rx.internal.util.unsafe.SpmcArrayQueueProducerIndexCacheField
lvProducerIndexCache, svProducerIndexCacheMethods inherited from class rx.internal.util.unsafe.SpmcArrayQueueConsumerField
casHead, lvConsumerIndexMethods inherited from class rx.internal.util.unsafe.SpmcArrayQueueProducerField
lvProducerIndex, soTailMethods inherited from class rx.internal.util.unsafe.ConcurrentCircularArrayQueue
calcElementOffset, calcElementOffset, clear, iterator, lpElement, lpElement, lvElement, lvElement, soElement, soElement, spElement, spElementMethods inherited from class java.util.AbstractQueue
add, addAll, element, removeMethods inherited from class java.util.AbstractCollection
contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Constructor Details
-
SpmcArrayQueue
public SpmcArrayQueue(int capacity)
-
-
Method Details
-
offer
Description copied from interface:MessagePassingQueueCalled from a producer thread subject to the restrictions appropriate to the implementation and according to theQueue.offer(Object)interface.- Parameters:
e-- Returns:
- true if element was inserted into the queue, false iff full
-
poll
Description copied from interface:MessagePassingQueueCalled from the consumer thread subject to the restrictions appropriate to the implementation and according to theQueue.poll()interface.- Returns:
- a message from the queue if one is available, null iff empty
-
peek
Description copied from interface:MessagePassingQueueCalled from the consumer thread subject to the restrictions appropriate to the implementation and according to theQueue.peek()interface.- Returns:
- a message from the queue if one is available, null iff empty
-
size
public int size()Description copied from interface:MessagePassingQueueThis method's accuracy is subject to concurrent modifications happening as the size is estimated and as such is a best effort rather than absolute value. For some implementations this method may be O(n) rather than O(1).- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceMessagePassingQueue<E>- Specified by:
sizein classAbstractCollection<E>- Returns:
- number of messages in the queue, between 0 and queue capacity or
Integer.MAX_VALUEif not bounded
-
isEmpty
public boolean isEmpty()Description copied from interface:MessagePassingQueueThis method's accuracy is subject to concurrent modifications happening as the observation is carried out.- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceMessagePassingQueue<E>- Overrides:
isEmptyin classAbstractCollection<E>- Returns:
- true if empty, false otherwise
-