title: Does polling block other operations in LinkedBlockingQueue?
body: <p>In the pseudocode below I have a <code>poll()</code> function that gets called forever in the main thread. When I do this without the <code>sleep()</code> statement in <code>poll()</code>, only 2-3 items a minute get added to the queue by the other thread. Does this mean that polling blocks the <code>put()</code> statement?</p>
  
  <p>How can I solve this problem?</p>
  
  <pre><code>public class Test extends Thread{
      private LinkedBlockingQueue&lt;Object&gt; queue = null;
  
      Test(){
          queue = new LinkedBlockingQueue&lt;Object&gt;(10);
      }
  
      public void run(){
          // Do stuff, get incoming object from network
          queue.put(o);
      }
  
      public Object poll(){
          Object o = queue.poll();
          sleep(1000);
          return o;
      }
  }
  </code></pre>