Interface ConcurrentQueue<V>

  • All Known Implementing Classes:
    ConcurrentQueueBlockingImpl, ConcurrentQueueImpl, ConcurrentQueueNonBlockingImpl

    public interface ConcurrentQueue<V>
    A class that provides a very simply unbounded queue. The main requirement here is that the class support constant time (very fast) deletion of arbitrary elements. An instance of this class must be thread safe, either by locking or by using a wait-free algorithm (preferred). The interface is made as simple is possible to make it easier to produce a wait-free implementation.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  ConcurrentQueue.Handle<V>
      A Handle provides the capability to delete an element of a ConcurrentQueue very quickly.
    • Method Detail

      • size

        int size()
        Return the number of elements in the queue.
      • offer

        ConcurrentQueue.Handle<V> offer​(V arg)
        Add a new element to the tail of the queue. Returns a handle for the element in the queue.
      • poll

        V poll()
        Return an element from the head of the queue. The element is removed from the queue.