Java / Concurrent collections
Explain LinkedBlockingQueue in Java concurrent collections.
The LinkedBlockingQueue class implements the BlockingQueue interface. It is introduced in Java 1.5.
The LinkedBlockingQueue keeps the elements internally in a linked structure (linked nodes). This linked structure can optionally have an upper bound if desired. If no upper bound is specified, Integer.MAX_VALUE is used as the upper bound.
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.
Linked queues typically have higher throughput than array-based queues but less predictable performance in most concurrent applications.
More Related questions...