Getting the Visual Studio 2010 CTP to use more than one hardware thread: using Hyper-V and other options

Last week, we blogged about the Visual Studio 2010 CTP which includes the Concurrency Runtime, the Parallel Pattern Library and the Asynchronous Agents Library which is available as a Virtual PC image.  As the Parallel Extensions to .NET team blogged yesterday, this is unfortunate because VPC images only have a single core and this isn't great for building parallel applications.

There's a couple of options to try out the CTP and the projects built with it on something other than a single-threaded VPC image.  Note that none of these are officially tested or supported so things may not work as expected.

One option which is straightforward for most C++ projects is to statically link in the Runtime Libraries in your applications and move them to another computer with more than a single CPU to test them. 

To do this open the solution explorer pane and right click on your C++ project and select properties. Under the C/C++ ->Code Generation property page under Runtime Library select "Multi-threaded (/MT)" for release builds and "Multi-threaded Debug (/MTd)" for debug builds.  Also note that if you're using MFC in your application on the General Property Page you'll need to change the "Use of MFC" setting to something other than "Use MFC in a Shared DLL."

Another option is to convert the Virtual PC image to a Hyper-V image which will allow you to see up to 4 hardware threads if they are available on your system. Grant Holliday has a guide on his blog for doing this.

An advantage to statically linking your application is you can run it at full speed outside of the VPC and install is straightforward; conversely an advantage to converting your VPC image to a Hyper-V image is that you can try the Parallel Debugger windows in the Visual Studio debugger.

As I said neither of these options is supported, but I do hope that they can help you make it easier to explore the Concurrency Runtime, Parallel Pattern Library and Asynchronous Agents Library.