Share via

Parallel Programming with Microsoft .NET

Design Patterns for Decomposition and Coordination on Multicore Architectures

Colin Campbell, Ralph Johnson, Ade Miller, Stephen Toub


patterns & practices Developer Center

January 2010


The CPU meter shows the problem. One core is running at 100 percent, but all the other cores are idle. Your application is CPU-bound, but you are using only a fraction of the computing power of your multicore system. What next?

The answer, in a nutshell, is parallel programming. Where you once would have written the kind of sequential code that is familiar to all programmers, you now fi nd that this no longer meets your performance goals. To use your system’s CPU resources effi ciently, you need to split your application into pieces that can run at the same time.

This is easier said than done. Parallel programming has a reputation for being the domain of experts and a minefi eld of subtle, hard-to-reproduce software defects. Everyone seems to have a favorite story about a parallel program that did not behave as expected because of a mysterious bug.

These stories should inspire a healthy respect for the diffi culty of the problems you face in writing your own parallel programs. Fortunately, help has arrived. Microsoft .NET Framework 4 introduces a new programming model for parallelism that signifi cantly simplifi es the job. Behind the scenes are supporting libraries with sophisticated algorithms that dynamically distribute computations on multicore architectures.

Proven design patterns are another source of help. Parallel Programming with Microsoft .NET introduces you to the most important and frequently used patterns of parallel programming and gives executable code samples for them, using the Task Parallel Library (TPL) and Parallel LINQ (PLINQ).

Printed and eBook


This title also available from Microsoft Press in both printed and ebook forms.

Community and Code Samples




Feedback and Support


This book describes patterns for parallel programming, with code examples, that use the new parallel programming support in the Microsoft® .NET Framework 4. This support is commonly referred to as the Parallel Extensions. You can use the patterns described in this book to improve your application's performance on multicore computers. Adopting the patterns in your code makes your application run faster today and also helps prepare for future hardware environments, which are expected to have an increasingly parallel computing architecture


This guide, like many patterns & practices deliverables, is associated with a community site. On this community site, you can post questions, provide feedback, or connect with other users for sharing ideas. Community members can also help Microsoft plan and test future guides, and download additional content such as extensions and training material.

Feedback and Support

Questions? Comments? Suggestions? To provide feedback about this guide, or to get help with any problems, please visit the Community site. The message board on the community site is the preferred feedback and support channel because it allows you to share your ideas, questions, and solutions with the entire community. Parallel Programming with Microsoft .NET is a guidance offering, designed to be reused, customized, and extended. It is not a Microsoft product. Code-based guidance is shipped "as is" and without warranties. Customers can obtain support through Microsoft Support Services for a fee, but the code is considered user-written by Microsoft support staff.

Next | Home | Community