title: Parallel.ForEach and global variable
body: <p>If I have code as following:</p>
  
  <pre><code>var dict = new Dictionary&lt;string, NetObject&gt;();
  Parallel.ForEach(results, options, result =&gt;                    
  {
      var items = parser.Parse(result);
      Parallel.ForEach(items, options, nextObject =&gt;                      
      {
          if (nextObject != null)
          {
              dict[nextObject.Id] = nextObject;
          }
      });
  });
  </code></pre>
  
  <p>The dict is a dictionary defined at method level. My question is, will it cause parallel foreach to work like normal foreach in synchronous manner since it is global object? I do not see any performance difference between normal foreach and parallel once for the code above.</p>