title: Are linq operations on concurrent collections thread safe?
body: <p>For example is the following code thread safe:</p>
  
  <pre><code>ConcurrentQueue&lt;Guid&gt; _queue = new ConcurrentQueue&lt;Guid&gt;();
  while(true)
  {
  for(int y = 0; y &lt; 3; y++)
  {
      if(y % 3 == 0)
      {
      System.Threading.Tasks.Task.Run(() =&gt; _queue.Enqueue(Guid.NewGuid()));
      }
      else if (y % 3 == 1)
      {
      Guid x;
      System.Threading.Tasks.Task.Run(() =&gt; _queue.TryDequeue(out x));
      }
      else if(y % 3 == 2)
      {
      System.Threading.Tasks.Task.Run(() =&gt;
      {
          if (_queue.Any(t =&gt; t == testGuid))
          {
          // Do something
          }
      });
  
      }
  }
  </code></pre>
  
  <p>Edit: Apparently the title wasn't clear enough so updated the code sample to include actual multi threaded behaviour, yes the code above is just a <em>sample</em> of multi-threaded behaviour. </p>