title: Can we add new elements to a list using Parallel.ForEach()?
body: <p>My code does very simple stuff</p>
  
  <p>list already has elements. I have approximately 25000 elements (and I'm expecting to have more) in the list and each element is small (DateTime).</p>
  
  <pre><code>List&lt;DateTime&gt; newList = new List&lt;DateTime&gt;();
  Parallel.ForEach(list, l =&gt; newlist.Add(new DateTime(l.Ticks + 5000)));
  </code></pre>
  
  <p>i.e, based on each element, I'm creating new elements and adding them to a different list.
  But, this doesn't seem to be a good programming approach. I hit this exceptions <strong><em>some</em></strong> times, but not everytime.</p>
  
  <pre><code>IndexOutOfRangeException : {"Index was outside the bounds of the array."}
  </code></pre>
  
  <p>Can we add elements to a list using Parallel.ForEach()? If yes, why do I hit the error? If no, why?</p>