Class FastBlockingQueue<T>
- java.lang.Object
-
- edu.berkeley.cs.jqf.instrument.util.FastBlockingQueue<T>
-
public final class FastBlockingQueue<T> extends Object
A blocking queue for single-producer and single-consumer where the producer and consumer never change and are distinct threads. This allows reading and writing from the queue without using system locks. The only synchronization is viavolatile
pointers for the producer and consumer in a fixed-size circular buffer. Reading from an empty queue and writing to a full queue results in a spinning wait, and therefore the producer and consumer must be distinct in order to avoid deadlocks.- Author:
- Rohan Padhye
-
-
Constructor Summary
Constructors Constructor Description FastBlockingQueue(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isEmpty()
boolean
isFull()
void
put(T item)
T
remove(long timeout)
-