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 void
clear()
boolean
isEmpty()
protected Node
lpConsumerNode()
protected Node
lvConsumerNode()
protected Node
lvProducerNode()
boolean
offer(Node node)
Node
peek()
Node
poll()
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.protected void
spConsumerNode(Node node)
protected Node
xchgProducerNode(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()
-
-