public class SPSCQueue<T>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SPSCQueue.PaddedLong |
| Modifier and Type | Field and Description |
|---|---|
protected T[] |
buffer |
VolatileLongCell |
head |
protected SPSCQueue.PaddedLong |
headCache |
protected int |
mask |
VolatileLongCell |
tail |
protected SPSCQueue.PaddedLong |
tailCache |
| Constructor and Description |
|---|
SPSCQueue(int initialSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
fillnb(T[] msg) |
static int |
findNextPositivePowerOfTwo(int value) |
boolean |
hasSpace() |
boolean |
isEmpty() |
boolean |
offer(T msg) |
T |
poll() |
void |
putMailbox(T[] buf,
MailboxSPSC mb) |
int |
size() |
protected T[] buffer
public final VolatileLongCell tail
public final VolatileLongCell head
protected final int mask
protected final SPSCQueue.PaddedLong tailCache
protected final SPSCQueue.PaddedLong headCache
public static int findNextPositivePowerOfTwo(int value)
public T poll()
public boolean offer(T msg)
public void putMailbox(T[] buf, MailboxSPSC mb) throws Pausable
Pausablepublic boolean fillnb(T[] msg)
public boolean isEmpty()
public boolean hasSpace()
public int size()