The June 2008 CTP of Parallel Extensions contained a first look at some of the work we’re doing to augment the .NET Framework with a set of additional coordination data structures that aid in the development of highly concurrent applications. This included two thread-safe collections,
Since the goal of Parallel Extensions is to simplify parallel programming, and the motivation behind parallel programming is performance, it is not surprising that many of the questions we receive about our CTP releases are performance-related.
Developers ask why one program shows a parallel speedup but another one does not,
Parallel Extensions includes the System.Threading.Parallel class, which provides several high-level loop replacement constructs like For and ForEach. In previous blog posts, we’ve taken a look at implementing other loops, such as for loops with arbitrary initialization, conditional, and update logic, range-based loops,
Parallel Extensions makes it easy to wait for Tasks to complete. Task exposes a Wait method, which can be used trivially:
Task t = Task.Create(…); … t.Wait();
Task also exposes several static methods for waiting on an array of tasks, either for all of them to complete or for any of them to complete:
Task t1 = Task.Create(…);
One of the primary reasons we’ve released CTPs of Parallel Extensions is to solicit feedback on the design and functionality it provides. Does it provide all of the APIs you need to get your job done? Are there scenarios you wished the APIs supported and that you need to work around in klunky ways?