Package org.jctools.queues
Interface QueueProgressIndicators
-
- All Known Implementing Classes:
AtomicReferenceArrayQueue,BaseMpscLinkedArrayQueue,BaseMpscLinkedAtomicArrayQueue,BaseSpscLinkedArrayQueue,BaseSpscLinkedAtomicArrayQueue,ConcurrentCircularArrayQueue,ConcurrentSequencedCircularArrayQueue,MpmcArrayQueue,MpmcArrayQueueConsumerIndexField,MpmcArrayQueueL1Pad,MpmcArrayQueueL2Pad,MpmcArrayQueueL3Pad,MpmcArrayQueueProducerIndexField,MpmcAtomicArrayQueue,MpmcAtomicArrayQueueConsumerIndexField,MpmcAtomicArrayQueueL1Pad,MpmcAtomicArrayQueueL2Pad,MpmcAtomicArrayQueueL3Pad,MpmcAtomicArrayQueueProducerIndexField,MpmcUnboundedXaddArrayQueue,MpscArrayQueue,MpscArrayQueueConsumerIndexField,MpscArrayQueueL1Pad,MpscArrayQueueL2Pad,MpscArrayQueueL3Pad,MpscArrayQueueMidPad,MpscArrayQueueProducerIndexField,MpscArrayQueueProducerLimitField,MpscAtomicArrayQueue,MpscAtomicArrayQueueConsumerIndexField,MpscAtomicArrayQueueL1Pad,MpscAtomicArrayQueueL2Pad,MpscAtomicArrayQueueL3Pad,MpscAtomicArrayQueueMidPad,MpscAtomicArrayQueueProducerIndexField,MpscAtomicArrayQueueProducerLimitField,MpscBlockingConsumerArrayQueue,MpscChunkedArrayQueue,MpscChunkedArrayQueueColdProducerFields,MpscChunkedAtomicArrayQueue,MpscChunkedAtomicArrayQueueColdProducerFields,MpscGrowableArrayQueue,MpscGrowableAtomicArrayQueue,MpscUnboundedArrayQueue,MpscUnboundedAtomicArrayQueue,MpscUnboundedXaddArrayQueue,MpUnboundedXaddArrayQueue,SequencedAtomicReferenceArrayQueue,SpmcArrayQueue,SpmcArrayQueueConsumerIndexField,SpmcArrayQueueL1Pad,SpmcArrayQueueL2Pad,SpmcArrayQueueL3Pad,SpmcArrayQueueMidPad,SpmcArrayQueueProducerIndexCacheField,SpmcArrayQueueProducerIndexField,SpmcAtomicArrayQueue,SpmcAtomicArrayQueueConsumerIndexField,SpmcAtomicArrayQueueL1Pad,SpmcAtomicArrayQueueL2Pad,SpmcAtomicArrayQueueL3Pad,SpmcAtomicArrayQueueMidPad,SpmcAtomicArrayQueueProducerIndexCacheField,SpmcAtomicArrayQueueProducerIndexField,SpscArrayQueue,SpscArrayQueueColdField,SpscArrayQueueConsumerIndexField,SpscArrayQueueL1Pad,SpscArrayQueueL2Pad,SpscArrayQueueL3Pad,SpscArrayQueueProducerIndexFields,SpscAtomicArrayQueue,SpscAtomicArrayQueueColdField,SpscAtomicArrayQueueConsumerIndexField,SpscAtomicArrayQueueL1Pad,SpscAtomicArrayQueueL2Pad,SpscAtomicArrayQueueL3Pad,SpscAtomicArrayQueueProducerIndexFields,SpscChunkedArrayQueue,SpscChunkedAtomicArrayQueue,SpscGrowableArrayQueue,SpscGrowableAtomicArrayQueue,SpscUnboundedArrayQueue,SpscUnboundedAtomicArrayQueue
public interface QueueProgressIndicatorsThis interface is provided for monitoring purposes only and is only available on queues where it is easy to provide it. The producer/consumer progress indicators usually correspond with the number of elements offered/polled, but they are not guaranteed to maintain that semantic.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcurrentConsumerIndex()This method has no concurrent visibility semantics.longcurrentProducerIndex()This method has no concurrent visibility semantics.
-
-
-
Method Detail
-
currentProducerIndex
long currentProducerIndex()
This method has no concurrent visibility semantics. The value returned may be negative. Under normal circumstances 2 consecutive calls to this method can offer an idea of progress made by producer threads by subtracting the 2 results though in extreme cases (if producers have progressed by more than 2^64) this may also fail.
This value will normally indicate number of elements passed into the queue, but may under some circumstances be a derivative of that figure. This method should not be used to derive size or emptiness.- Returns:
- the current value of the producer progress index
-
currentConsumerIndex
long currentConsumerIndex()
This method has no concurrent visibility semantics. The value returned may be negative. Under normal circumstances 2 consecutive calls to this method can offer an idea of progress made by consumer threads by subtracting the 2 results though in extreme cases (if consumers have progressed by more than 2^64) this may also fail.
This value will normally indicate number of elements taken out of the queue, but may under some circumstances be a derivative of that figure. This method should not be used to derive size or emptiness.- Returns:
- the current value of the consumer progress index
-
-