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>>
producerQueue
protected 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 void
addQueue(Queue<E> q)
boolean
isEmpty()
Iterator<E>
iterator()
boolean
offer(E e)
E
peek()
E
poll()
protected void
removeQueue(Object q)
int
size()
-
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:
size
in interfaceCollection<E>
- Specified by:
size
in classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<E>
- Overrides:
isEmpty
in classAbstractCollection<E>
-
iterator
public Iterator<E> iterator()
- Specified by:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Specified by:
iterator
in classAbstractCollection<E>
-
addQueue
protected final void addQueue(Queue<E> q)
-
removeQueue
protected final void removeQueue(Object q)
-
-