Class MpscIntrusiveLinkedQueue


  • public class MpscIntrusiveLinkedQueue
    extends Object
    • Field Detail

      • stub

        protected final Node stub
    • Constructor Detail

      • MpscIntrusiveLinkedQueue

        public MpscIntrusiveLinkedQueue()
    • 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()
      • xchgProducerNode

        protected final Node xchgProducerNode​(Node node)