From javadoc:
- A
ConcurrentLinkedQueue
is an appropriate choice when many threads will share access to a common collection. This queue does not permit null elements. ArrayBlockingQueue
is a classic "bounded buffer", in which a fixed-sized array holds elements inserted by producers and extracted by consumers. This class supports an optional fairness policy for ordering waiting producer and consumer threadsLinkedBlockingQueue
typically have higher throughput than array-based queues but less predictable performance in most concurrent applications.
I have 2 scenarios, one requires the queue to support many producers (threads using it) with one consumer and the other is the other way arround.
I am not understanding whether I should use ConcurrentLikedQueue or the other ones (the array or linkedList implementations). Wherent' all this implementations supposed to be concurrent? I mean, can somebody explain me what is the diference between ConcurrentLikedQueue and LinkedBlockingQueue ?
Also, what is the optional fairness policy thing in the ArrayBlockingQueue please ?
Thanks a lot !