May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Parallel.InvokeThe first way for running tasks in parallel is calling the Parallel.Invoke shared method. This method can receive an array of System.Action objects as parameter, so each Action is translated by the runtime into a task. If possible, tasks are executed in parallel. The following example demonstrates how to perform three calculations concurrently:

In the example the code takes advantage of statement lambdas; each of them is translated into a task by the runtime that is also responsible for creating and scheduling threads and for scaling tasks across all available processors. If you run the code you can see how the ...
Read now
Unlock full access