An unbounded thread-safe
based on linked nodes.
This queue orders elements FIFO (first-in-first-out).
The head of the queue is that element that has been on the
queue the longest time.
The tail of the queue is that element that has been on the
queue the shortest time. New elements
are inserted at the tail of the queue, and the queue retrieval
operations obtain elements at the head of the queue.
A ConcurrentLinkedQueue is an appropriate choice when
many threads will share access to a common collection.
This queue does not permit null elements.
This implementation employs an efficient "wait-free"
algorithm based on one described in Simple,
Fast, and Practical Non-Blocking and Blocking Concurrent Queue
Algorithms by Maged M. Michael and Michael L. Scott.
Beware that, unlike in most collections, the size method
is NOT a constant-time operation. Because of the
asynchronous nature of these queues, determining the current number
of elements requires a traversal of the elements.
This class implements all of the optional methods
of the
Collection and
Iterator interfaces.
This class is a member of the
Java Collections Framework.
since: 1.5 author: Doug Lea< Parameters: E - > the type of elements held in this collection |