Got "Index out of bounds" Error on List.Add() in c#
<p>Here is the code</p>

<pre><code>List&lt;string&gt; something = new List&lt;string&gt;();
Parallel.ForEach(anotherList, r =&gt;
     {
            .. do some work
             something.Add(somedata);
      });
</code></pre>

<p>I get the <code>Index out of bounds</code> error around 1 time per hundred run. Is there anyway to prevent the conflict (I assume) caused by threading?</p>
