LinkedBlockingQueue

This is an implementation of the BlockingQueue interface, which is backed up by a linked list. The size of the queue is not limited by default (to be precise, it is Integer.MAX_VALUE), but it can optionally be limited in a constructor argument. The reason to limit the size in this implementation is to aid the use when the parallel algorithm performs better with a limited size queue. The implementation itself does not have any restriction on the size other than Integer.MAX_VALUE, which is fairly big.

Get Java Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.