title: How do I iterate concurrent queue repeatedly?
body: <p>I am using Winforms and targeting .Net 4.5</p>
  
  <p>I want to iterate concurrent queue for as long as it has items. In my application, the user can add and remove items to the concurrent queue at any point.</p>
  
  <p>Sample code:</p>
  
  <pre><code>ConcurrentQueue&lt;string&gt; cq = new ConcurrentQueue&lt;string&gt;();
  
  cq.Enqueue("First");
  cq.Enqueue("Second");
  cq.Enqueue("Third");
  cq.Enqueue("Fourth");
  cq.Enqueue("Fifth");
  
  private void someMethod(string)
  {
     //do stuff
  }
  
  while (!cq.IsEmpty)
  {
     //how do I do the code below in a loop?
  
     //inner loop starts here 
     someMethod(current cq item);
     //move to the next item
     someMethod(the next cq item);
     //move to the next item
     someMethod(the next cq item);
     . 
     .
     .
     //if last item is reached, start from the top
  
  }
  </code></pre>
  
  <p>Keep in mind that the application user can add or remove items from the queue at any time, even when the while loop is running.</p>