title: Spinning causes weird effects
body: <p>I have an observation loop, quite simply:</p>
  
  <pre><code>BlockingQueue&lt;Object&gt; q = new ArrayBlockingQueue(LENGTH);
  while (true) {
      Object o = null;
      int spins = 0;
  
      // SPINNING LOOP
      while (spins++ &lt; 1000)
          // Poll queue q, check if o is still null
      if (o == null)
          // Await for condition to be signaled
  
      // Inspect Object o
  }
  </code></pre>
  
  <p>What I'm finding is: if the spin count is increased, you can insert items into the queue faster, but items can't be taken out as fast. But, if it is lowered, items are taken out faster at the cost of insertion speed. I am finding this by measuring the add method for insertion, and measuring the time between insertion and inspection for takeout time.</p>
  
  <p>So in the example above, you can insert items quickly, but objects will be inspected slower. </p>
  
  <p>Is there a possible explanation for that?</p>