Online resource kit >

HomeAt a GlanceDeveloperIT Pro

Concurrency Runtime Deep Dive: How to Harvest Multicore Computing Resources

< Go Back

This session focuses on the new Concurrency Runtime available as part of Microsoft Visual C++ 2010 (this is not to be confused with the Concurrency and Coordination Runtime, which is a separate offering from the Microsoft Robotics team). As a 400-level talk, discussions focus on the inner workings of the runtime (which are described as the “CRT for concurrency”), as well as how to integrate with and build on top of the runtime.

The need for the Concurrency Runtime is based on several premises. First, it is important to enable the power of parallel hardware through a rich ecosystem of languages, libraries, and tools. Second, no single company, algorithm, or scheduler is going to provide all concurrent solutions. And third, there is a clear need for a common infrastructure for Microsoft partners and customers to build on (Intel has already announced integration with the Concurrency Runtime for TBB, OpenMP, and Parallel Studio).

The runtime is effectively split into two layers: a resource manager and a scheduler. The resource manager serves requests for physical processors, enabling both the built-in and third-party schedulers. The scheduler is responsible for getting work items executed, is policy-driven, supports multiple scheduler instances, and uses work-stealing algorithms for very efficient execution. The session describes the internal operations of the scheduler and resource manager and how the Parallel Pattern Library builds on top of the APIs these entities provide. The session then explains how to build new algorithms, such as a custom parallel reduction operation and a new messaging block for round-robin alternation, and demonstrates how to write a simple, custom scheduler that targets the resource management layer.

The first demonstration of this session covers recursive reduction of a vector (for example, summing all the values of a vector). The second demonstration covers parallel implantation of Fibonacci, allocating processors as work builds and interacting with the Resource Manager to adjust the resources available to a program.

The session concludes with the following points:

  • Concurrency is a hard problem that requires sophisticated tool support. Microsoft is providing these tools so you do not have to worry about details.
  • There is no silver bullet to parallelizing a program. You still need to determine what and how to parallelize.
  • The CCR library provides a robust base for extension with your apps.
View