Class SpmcArrayQueue<E>

    • Field Detail

      • C_INDEX_OFFSET

        protected static final long C_INDEX_OFFSET
      • P_INDEX_OFFSET

        protected static final long P_INDEX_OFFSET
    • Constructor Detail

      • SpmcArrayQueue

        public SpmcArrayQueue(int capacity)
    • Method Detail

      • offer

        public boolean offer(E e)
      • poll

        public E poll()

        Note that we are not doing the the whole poll/tryPoll thing here like we do in MPMC/MPSC, that is because the problem we try to solve there is caused by having multiple producers making progress concurrently which can create 'bubbles' of claimed but not fully visible elements in the queue. For a single producer the problem doesn't exist.

      • peek

        public E peek()
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • lvProducerIndexCache

        protected final long lvProducerIndexCache()
      • svProducerIndexCache

        protected final void svProducerIndexCache(long v)
      • lvConsumerIndex

        protected final long lvConsumerIndex()
      • casHead

        protected final boolean casHead(long expect,
                                        long newValue)
      • lvProducerIndex

        protected final long lvProducerIndex()
      • soTail

        protected final void soTail(long v)