Package org.jctools.queues
Class IndexedQueueSizeUtil
java.lang.Object
org.jctools.queues.IndexedQueueSizeUtil
A note to maintainers on index assumptions: in a single threaded world it would seem intuitive to assume:
producerIndex >= consumerIndex
As an invariant, but in a concurrent, long running settings all of the following need to be considered:
-
consumerIndex > producerIndex
: due to counter overflow (unlikey with longs, but easy to reason) -
consumerIndex > producerIndex
: due to consumer FastFlow like implementation discovering the element before the counter is updated. -
producerIndex - consumerIndex invalid input: '<' 0
: due to above. -
producerIndex - consumerIndex > Integer.MAX_VALUE
: as linked buffers allow constructing queues with more thanInteger.MAX_VALUE
elements.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static int
-
Constructor Details
-
IndexedQueueSizeUtil
public IndexedQueueSizeUtil()
-
-
Method Details
-
size
-
isEmpty
-