Windows with C++: Visual C++ 2010 and the Parallel Patterns Library

My latest Windows with C++ column in the February 2009 issue of MSDN Magazine is now online:

Windows with C++: Visual C++ 2010 and the Parallel Patterns Library

Visual C++ is getting a major upgrade in the 2010 release of Visual Studio. Many of the new language and library features are designed purely to make it easier and more natural to express your desires in code. But as has always been the case with C++, the combination of these features is what makes C++ such a powerful and expressive language.

So this month I am going to introduce some of the additions to the C++ language that Visual C++ has added as part of the forthcoming C++0x standard. I'll then look at the Parallel Patterns Library (PPL) that Microsoft has developed over and above the C++0x standard to introduce parallelism to your applications in a manner that naturally complements the standard C++ library.

This article was a bit hard to write as the pre-release version of Visual Studio 2010 that I had at the time of writing was very unstable. The IDE has a long way to go before it is ready for day to day use. There is however a great deal to look forward to for the native C++ developer and I hope you enjoy this introduction to some of the new language and library features.

If you’re looking for one of my previous articles here is a complete list of them for you to browse through.

Produce the highest quality screenshots with the least amount of effort! Use Window Clippings.

Published Tuesday, January 27, 2009 9:25 AM by KennyKerr

Comments

# re: Windows with C++: Visual C++ 2010 and the Parallel Patterns Library

Tuesday, January 27, 2009 7:11 AM by Leo Davidson

It's great that there's a focus on C++ again but I would sacrifice every single new feature, without exception, just to see the Project Settings dialog redesigned into something sensible. :(

It's so sad that it causes problems for so many people yet the VS devs don't seem to realise let alone treat it as a priority. (Do they use the same IDE that we do??)

(Discussion of it in the comments thread here: blogs.msdn.com/.../printf-hello-msbuild-n.aspx )

Still, there are some cool new things coming in 10 that will come in handy every so often. Just not as often as the Project Settings dialog drives many of us crazy. :-)

Regarding the "auto" type, which looks very handy for templates, does the IDE give you a way to find out what the type is? i.e. Can you do something like hover over the word "auto" and get a intellisense tooltip telling you what the implicit type will be?

The PPL stuff, like OpenMP but better, seems useful. I can't see it replacing explicit thread management for "big" things, like the architecture of a large application, but I don't think it's supposed to. My feeling is it's there to provide a lightweight (in terms of typing and boilerplate code) way to harness threads within small, self-contained bits of code. Maybe I'm wrong and it will turn out to be a good way to manage all threads in general but that's my gut feeling.

# re: Windows with C++: Visual C++ 2010 and the Parallel Patterns Library

Wednesday, January 28, 2009 2:56 AM by KennyKerr

Leo: The Visual C++ team is not as focused on building a highly-productive IDE as the Visual C# team is. It’s a matter of priorities I guess. In the area of project settings I think the approach taken by the Visual C# team is even worse though.

Yes, auto variables provide type information at runtime within the debugger. I don’t have VC10 handy so I can’t be more specific.

PPL along with Asynchronous Agents (something I hope to cover in a future article) are so much more than OpenMP and are actually aimed at the “big” things as you describe. They are however very lightweight and composable. You can use as little or as much of it as you need/desire and combine it with other threading libraries without conflict.

# re: Windows with C++: Visual C++ 2010 and the Parallel Patterns Library

Monday, February 02, 2009 5:06 AM by Leo Davidson

Interesting. I look forward to the Async Agents coverage. You do a great job of introducing these new features in an easy-to-digest way. Thanks :)