Class FairBlockingQueue<E>

  • Type Parameters:
    E - Type of element in the queue
    All Implemented Interfaces:
    Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>

    public class FairBlockingQueue<E>
    extends Object
    implements BlockingQueue<E>
    A simple implementation of a blocking queue with fairness waiting. invocations to method poll(...) will get handed out in the order they were received. Locking is fine grained, a shared lock is only used during the first level of contention, waiting is done in a lock per thread basis so that order is guaranteed once the thread goes into a suspended monitor state.
    Not all of the methods of the BlockingQueue are implemented.