Changing foreach loops to Parallel.ForEach and weird bugs
<p>I have several loops that I wrote using the traditional syntax</p>

<pre><code>foreach(x in xs) {....}
</code></pre>

<p>Some of these loops are pretty intensive in terms of computation and I just changed them using the parallel syntax like this:</p>

<pre><code>Parallel.ForEach(x, xs =&gt; {...});
</code></pre>

<p>I see a major increase in performance!! Now my question is this: Am I introducing bugs using parallel multithreading? I read that thread safety is complex and can create weird bugs; what should I be concerned about?</p>
