Online resource kit >

HomeAt a GlanceDeveloperIT Pro

Parallel Programming for C++ Developers in the Next Version of Microsoft Visual Studio

< Go Back

This talk covers the new programming models and runtime components being introduced into Microsoft Visual C++ 2010 for parallelism and concurrency, focusing primarily on programming models. The session starts off with a brief discussion of why parallelism is important and why it is so difficult with existing technologies. The session then dives into the native concurrency platform in Microsoft Visual Studio 2010, discussing the Concurrency Runtime, the Parallel Pattern Library (PPL), and the Asynchronous Agents Library. Along the way, the session demonstrates new debugger tool windows, Parallel Tasks, and Parallel Stacks, which make it easier to debug parallel applications.

The Concurrency Runtime provides low-overhead scheduling and load balancing, and the runtime includes supports for cooperative blocking and for multiple scheduler instances. The runtime provides common resource management support that is able to dynamically load balance execution resources between schedulers. And the runtime provides a platform that is extensible and composable, enabling others to integrate concurrent libraries that compose well with other programming models. Intel has announced that they are implementing support for the Concurrency Runtime into their Parallel Studio.

The Parallel Pattern Library simplifies writing parallel applications by raising the level of abstraction and by providing alternatives to shared state. The library also enables the unlocking of platform performance by providing developers with concurrent algorithms and containers. Core building blocks in PPL are task_handle and task_group and example algorithms include parallel_for, parallel_for_each, and parallel_invoke. The algorithms are designed to work well with the Standard Template Library (STL). Example data structures include a combinable object for doing thread-local reductions, concurrent collections, runtime-aware locks, and more. A new C++0x language feature, lambda expressions, makes the PPL easier to integrate into existing code.

The Asynchronous Agents Library provides several building blocks for highly concurrent applications. This includes coarse-grained agents, sources, and targets (participants in message passing that propagate messages from source to target when connected), and cooperative send and receive utility functions, which facilitate message passing and utilize the cooperative Concurrency Runtime.

This session includes the following demonstrations:

  • Matrix multiplication: Parallelizing a matrix multiplication by changing one line of code and achieving a significant speedup
  • Debugger tool windows: Parallel Stacks and Parallel Tasks views in the Visual Studio 2010 debugger
  • Image pipelining: Uses both PPL and agents to parallelize an application that loads images from disk and performs transforms on them, achieving significant parallel speedups
View