If you look at the List<T> documentation -
List<t> Class, MSDN[
^]
You will find this at the bottom:
Quote:
It is safe to perform multiple read operations on a List<t>, but issues can occur if the collection is modified while it’s being read. To ensure thread safety, lock the collection during a read or write operation. To enable a collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. For collections with built-in synchronization, see the classes in the System.Collections.Concurrent namespace. For an inherently thread–safe alternative, see the ImmutableList<t> class.
If you do not implement locking inside the Parallel.ForEach, you will get unpredictable behaviour.