The form of data parallelism that I find most helpful is performing concurrent operations on collections of data. This allows us to take data collections such as lists, dataviews, dictionaries, and so on and perform a task on each item in the collection in parallel with a single line of code! This makes using data parallelism simpler; you have to do nothing more than normal data processing. This is one of the reasons why the TPL is such a wonderful enhancement to .NET.
Much like the
Parallel.For method, the structure of
Parallel.ForEach looks like the following:
Parallel.ForEach(dataCollection, item => DoWork(item));
There are two parameters in the most basic version of this method. There is ...