title: java.util.concurrent.LinkedBlockingQueue is not FIFO?
body: <p>The brief description of <a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/LinkedBlockingQueue.html" rel="nofollow">java.util.concurrent.LinkedBlockingQueue</a> says it is a FIFO queue, which means if thread A adds a bunch of entries (a1, a2, ... an) into the queue first and then thread B adds some more stuff into the queue (b1, b2, ... bm), then some consumer threads should exhaust all entries from A before taking on these from B (thus FIFO).  But what I have seen is that the entries from A and these from B are interleaved even though B adds its entries much later than A. I was at a code review for some Tomcat + Jersey application, and it uses a singleton <code>LinkedBlockingQueue</code> plus a handful of asynchronous worker threads to process the request entries from clients.  </p>
  
  <p>I was questioning about the fairness of the code since late arriving requests would have to wait in the queue until earlier entries are all exhausted (a client can submit thousands of entries per request), but to my surprise, the late arrival clients got their responses back almost immediately.  So does this mean <code>LinkedBlockingQueue</code> is not FIFO?? Please help for I am very confused.</p>