title: parallel.foreach works, but why?
body: <p>Can anyone explain, why this program is returning the correct value for sqrt_min?</p>
  
  <pre><code>int n = 1000000;
  
  double[] myArr = new double[n];
  for(int i = n-1 ; i&gt;= 0; i--){ myArr[i] = (double)i;}
  
  // sqrt_min contains minimal sqrt-value
  double sqrt_min = double.MaxValue;
  
  Parallel.ForEach(myArr, num =&gt;
  {
  double sqrt = Math.Sqrt(num); // some time consuming calculation that should be parallized
  if(sqrt &lt; sqrt_min){ sqrt_min = sqrt;}
  });
  Console.WriteLine("minimum: "+sqrt_min);
  </code></pre>