Package org.jctools.queues.intrusive
Class MpscIntrusiveLinkedQueue
- java.lang.Object
-
- org.jctools.queues.intrusive.MpscIntrusiveLinkedQueue
-
public class MpscIntrusiveLinkedQueue extends Object
-
-
Constructor Summary
Constructors Constructor Description MpscIntrusiveLinkedQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleanisEmpty()protected NodelpConsumerNode()protected NodelvConsumerNode()protected NodelvProducerNode()booleanoffer(Node node)Nodepeek()Nodepoll()intsize()This is an O(n) operation as we run through all the nodes and count them.
The accuracy of the value returned by this method is subject to races with producer/consumer threads.protected voidspConsumerNode(Node node)protected NodexchgProducerNode(Node node)
-
-
-
Field Detail
-
stub
protected final Node stub
-
-
Method Detail
-
offer
public boolean offer(Node node)
-
poll
public Node poll()
-
peek
public Node peek()
-
clear
public void clear()
-
size
public int size()
This is an O(n) operation as we run through all the nodes and count them.
The accuracy of the value returned by this method is subject to races with producer/consumer threads. In particular when racing with the consumer thread this method may under estimate the size.
Note that passing nodes between queues, or concurrent requeuing of nodes can cause this method to return strange values.
-
isEmpty
public boolean isEmpty()
-
spConsumerNode
protected final void spConsumerNode(Node node)
-
lvConsumerNode
protected final Node lvConsumerNode()
-
lpConsumerNode
protected final Node lpConsumerNode()
-
lvProducerNode
protected final Node lvProducerNode()
-
-