C++ Concurrency Runtime

Figure 1

Microsoft recommends that Developers designing applications for multi-core systems with NUMA computer architectures consider using the C++ Concurrency Runtime. This is especially the case for applications within the category of parallel-computing and shared memory computing. The Concurrency Runtime provides the benefits of concurrent task scheduling without YOU having to build a custom scheduler that is appropriately reentrant, thread-safe, and non-blocking.

The Concurrency Runtime contains a Task Scheduler and a Resource Manager component that integrates with the underlying Windows operating system. The Resource Manager manages access to system resources like the collection of CPU’s.

On legacy platforms (Vista, XP, Server 2008) the Concurrency Runtime leverages system thread pools for task scheduling.

But, on Windows 7 and Windows Sever 2008 R2, the Concurrency Runtime uses the new high-performance User-Mode-Scheduling (UMS) operating system capability described within the previous section.

UMS is a light-weight mechanism that an application or library can use to schedule its own threads. An application can switch between threads in user-mode without involving the operating system thread scheduler and thus maintain control of the processor. A UMS based Scheduler never blocks on worker threads making kernel transitions.

The Parallel Platform also supports multiple Programming Models. The Parallel Pattern Library (PPL) includes mechanisms that provide an easy and convenient way to express fine-grain parallelismwithin your applications. The PPL provides patterns for Task Execution, Synchronization, and Data Sharing.

The Agents Library (or Asynchronous Agents Library) enables parallel design based upon workload partitioning, isolation, and data-sharing via message passing. Agents enable you to express parallelism with broad granularity. You may combine both Agents and PPL constructs within the same solution.

The Concurrency Runtime also includes Data Structures that are “scheduler aware” enabling you to optimally specify task scheduling requests and custom scheduler policies.

Visual Studio 2010 also includes complementary new tools for parallel application development and testing. These include a new parallel debugger and a new parallel application profiler.