Package org.jctools.queues
Class MpscOnSpscQueue<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- org.jctools.queues.MpscOnSpscQueue<E>
-
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Queue<E>
public final class MpscOnSpscQueue<E> extends AbstractQueue<E> implements Queue<E>
-
-
Field Summary
Fields Modifier and Type Field Description protected ThreadLocal<Queue<E>>producerQueueprotected Queue<E>[]queues
-
Constructor Summary
Constructors Constructor Description MpscOnSpscQueue(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddQueue(Queue<E> q)booleanisEmpty()Iterator<E>iterator()booleanoffer(E e)Epeek()Epoll()protected voidremoveQueue(Object q)intsize()-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
-
-
-
Field Detail
-
producerQueue
protected final ThreadLocal<Queue<E>> producerQueue
-
queues
protected volatile Queue<E>[] queues
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<E>- Overrides:
isEmptyin classAbstractCollection<E>
-
iterator
public Iterator<E> iterator()
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin classAbstractCollection<E>
-
addQueue
protected final void addQueue(Queue<E> q)
-
removeQueue
protected final void removeQueue(Object q)
-
-