Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Queue implementations, which one?
    primarykey
    data
    text
    <p>From Javadoc:</p> <ul> <li>A <a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html" rel="noreferrer">ConcurrentLinkedQueue</a> is an appropriate choice when many threads will share access to a common collection. This queue does not permit null elements.</li> <li><a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ArrayBlockingQueue.html" rel="noreferrer">ArrayBlockingQueue</a> 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 threads</li> <li><a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/LinkedBlockingQueue.html" rel="noreferrer">LinkedBlockingQueue</a> typically have higher throughput than array-based queues but less predictable performance in most concurrent applications.</li> </ul> <p>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 around.</p> <p>I am not understanding whether I should use <code>ConcurrentLikedQueue</code> 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 difference between <code>ConcurrentLikedQueue</code> and <code>LinkedBlockingQueue</code>?</p> <p>Also, what is the optional fairness policy thing in the <code>ArrayBlockingQueue</code> please?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload