Class FastBlockingQueue<T>
java.lang.Object
edu.berkeley.cs.jqf.instrument.util.FastBlockingQueue<T>
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 via
volatile 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 -
Method Summary
-
Constructor Details
-
FastBlockingQueue
public FastBlockingQueue(int size)
-
-
Method Details
-
isEmpty
public final boolean isEmpty() -
isFull
public final boolean isFull() -
put
-
remove
-