This is the simplest
Parallel
form of it:
http://msdn.microsoft.com/en-us/library/dd783539.aspx[
^].
Please see others:
http://msdn.microsoft.com/en-us/library/system.threading.tasks.parallel.aspx[
^].
Do you understand it right? Basically, yes, but you should also understand a number of related issues. Most importantly, parallel executions is based on threads, and the tasks are automatically dispatched on the threads. This mechanism itself has considerable overhead. So, if, for example, you have only one CPU code (or not enough cores), you will not gain any throughput, will only use. It also depends on a number of other processes on the system in active (meaning, non-wait) states. Roughly speaking, they will eat up CPU time and will leave you with less then one code, on average, so you will loose performance, not gain. Also, the actions called in the loop body should be highly independent. If they wait for each other for considerable amount of time, you will, again, loose in overall throughput even if other processes don't use CPU resources at all.
Due to all that reasons, the processes which gain performance from parallel loops are not so typical. There are a lot of misconception about a power of parallel execution among developers.
—SA