MpmcArrayQueue
it is designed to provide a better scaling when more
producers are concurrently offering.poll()
could spin while awaiting a new element to be available:
to avoid this behaviour relaxedPoll()
should be used instead, accounting for the semantic differences
between the twos.
Access | Constructor and Description |
---|---|
public | MpmcUnboundedXaddArrayQueue(int
The buffer size to be used in each chunk of this queue chunkSize, int The maximum number of reused chunks kept around to avoid allocation, chunks are pre-allocated maxPooledChunks)
|
public |
Modifier and Type | Method and Description |
---|---|
public int | fill(MessagePassingQueue.
Implements io. |
private E | linkNextConsumerChunkAndPoll(MpmcUnboundedXaddChunk<E> cChunk, MpmcUnboundedXaddChunk<E> next, long expectedChunkIndex)
|
pack-priv final MpmcUnboundedXaddChunk | newChunk(long index, MpmcUnboundedXaddChunk<E> prev, int chunkSize, boolean pooled)
Implements abstract io. |
public boolean | offer(E
not e)null , will throw NPE if it isImplements io. Queue#offer(Object) interface.
|
public E | peek()
Implements io. Queue#peek() interface.
|
public E | poll()
Implements io. Queue#poll() interface.
|
public E | relaxedPeek()
Implements io. |
public E | relaxedPoll()
Implements io. |
MpmcUnboundedXaddArrayQueue | back to summary |
---|---|
public MpmcUnboundedXaddArrayQueue(int chunkSize, int maxPooledChunks)
|
MpmcUnboundedXaddArrayQueue | back to summary |
---|---|
public MpmcUnboundedXaddArrayQueue(int chunkSize) |
fill | back to summary |
---|---|
public int fill(MessagePassingQueue. Implements io. Doc from io. Stuff the queue with up to limit elements from the supplier. Semantically similar to:
There's no strong commitment to the queue being full at the end of a fill. Called from a producer thread subject to the restrictions appropriate to the implementation Warning Explicit assumptions are made with regards to
|
linkNextConsumerChunkAndPoll | back to summary |
---|---|
private E linkNextConsumerChunkAndPoll(MpmcUnboundedXaddChunk<E> cChunk, MpmcUnboundedXaddChunk<E> next, long expectedChunkIndex) |
newChunk | back to summary |
---|---|
pack-priv final MpmcUnboundedXaddChunk Implements abstract io.
|
offer | back to summary |
---|---|
public boolean offer(E e) Implements io. Doc from io. Called from a producer thread subject to the restrictions appropriate to the implementation and
according to the
|
peek | back to summary |
---|---|
public E peek() Implements io. Doc from io. Called from the consumer thread subject to the restrictions appropriate to the implementation and
according to the
|
poll | back to summary |
---|---|
public E poll() Implements io. Doc from io. Called from the consumer thread subject to the restrictions appropriate to the implementation and
according to the
|
relaxedPeek | back to summary |
---|---|
public E relaxedPeek() Implements io. Doc from io. Called from the consumer thread subject to the restrictions appropriate to the implementation. As
opposed to
|
relaxedPoll | back to summary |
---|---|
public E relaxedPoll() Implements io. Doc from io. Called from the consumer thread subject to the restrictions appropriate to the implementation. As
opposed to
|