The so-called read source code, three points to see the code, seven points to see comments. English is not good how to do, I help you translate!
package java.util.concurrent
public class LinkedBlockingQueue<E>
extends AbstractQueue<E>
implements BlockingQueue<E>, java.io.Serializable
Copy the code
A blocking queue based on linked Nodes with optional boundaries. This queue is sorted based on FIFO (first in, first out). The head node of the queue is the element that has been in the queue the longest. The end of the queue is the element that has been in the queue for the shortest time. The new element will be inserted at the end of the queue, and the fetch operation of the queue will fetch the head of the queue. Queues based on lists generally have higher throughput than queues based on arrays, but performance in multithreaded applications is more difficult to predict. The linked list queue can hold more elements, so the throughput is higher. In multithreading, the number of elements in a linked list is unpredictable. If the number of elements is too large, the performance will naturally deteriorate.
Optional capacity boundary constructor parameter as a way to prevent excessive queue expansion. The capacity, if not specified, is equal to the maximum value set to Integer. The nodes of the linked list are created dynamically with each insertion, unless the insertion causes the queue (element) to exceed the specified capacity.
This class and its iterators implement all the optional methods of the Collection and Iterator interfaces.
This class is part of the Java Collections Framework.
Since: 1.5