I am using the below code
var processed = new List();
Parallel.ForEach(items, item =>
{
processed.Add(SomeProcessingFunc(item));
});
From Jon Skeet's Book C# in Depth:
As part of Parallel Extensions in .Net 4, there are several new collections in a new
System.Collections.Concurrentnamespace. These are designed to be safe in the face of concurrent operations from multiple threads, with relatively little locking.
These include:
IProducerConsumerCollectionBlockingCollectionConcurrentBagConcurrentQueueConcurrentStackConcurrentDictionary