<p>I'm running Visual Studio 2008 with the stuff-of-nightmares awful MS test framework.  Trouble is that it's sending my CPU to 100% (well 25% on a quad-core).</p>

<p>My question is why can't Visual Studio run on more than one core?  Surely M$ must have a sufficient handle on threading to get this to work.</p>

[{'answer_id': 53949, 'author': 'Mark Ingram', 'author_id': 986, 'author_profile': 'https://Stackoverflow.com/users/986', 'pm_score': 4, 'selected': False, 'text': '<p>I have VS2008 running on all 4 CPUs. Just set this environment variable / project flag.</p>\n\n<p>/MP</p>\n\n<p>(It can be set in C/C++ Settings, Advanced. In project settings)</p>\n\n<p>Edit: The MP flag can also accept a number, e.g. /MP2 which means it will only run on 2 cores. Leaving it as just /MP means it will run on the maximum amount of cores.</p>\n\n<p>Edit2: The MP flag is probably for the compiler only.</p>\n'}, {'answer_id': 53954, 'author': 'pete blair', 'author_id': 5119, 'author_profile': 'https://Stackoverflow.com/users/5119', 'pm_score': 2, 'selected': False, 'text': '<p>We also added multiple core support for doing multi-threaded builds on the command line for those of you with a lot of projects and long build times.  Enabling multiple core support requires only a few new properties, and MSBuild manages all of the work to schedule projects efficiently and effectively.  The MSBuild team has tested this ability to scale by building some projects on a 64-CPU machine.</p>\n\n<p>that is from <a href="http://blogs.msdn.com/somasegar/archive/2007/08/15/visual-studio-2008-msbuild.aspx" rel="nofollow noreferrer">somasegar blog</a></p>\n\n<p>So they sort of started doing it, well at least for the build.</p>\n'}, {'answer_id': 53995, 'author': 'pete blair', 'author_id': 5119, 'author_profile': 'https://Stackoverflow.com/users/5119', 'pm_score': 0, 'selected': False, 'text': '<p>The /MP flag is only for builds, we at least it is according to this <a href="http://msdn.microsoft.com/en-us/library/bb385193.aspx" rel="nofollow noreferrer">msdn</a></p>\n\n<p>Now I would love to be wrong about it, but im pretty sure its just for builds. Which of course is still very useful.</p>\n'}, {'answer_id': 54012, 'author': 'Aardvark', 'author_id': 3655, 'author_profile': 'https://Stackoverflow.com/users/3655', 'pm_score': 0, 'selected': False, 'text': "<p>I'm sure it's very hard. Huge existing GUI-heavy non-threaded code base to multi-threaded. Sounds like a 10 to me.</p>\n\n<p><strong><em>But</em></strong> it seems to use multi-cores to me. The Intellesense seems threaded. The build system has multi-project building and for C++ multi-file building as well.</p>\n\n<p>You problems with these tools sounds a bit deeper then how well they use you CPUs.</p>\n"}, {'answer_id': 783178, 'author': 'Colin Desmond', 'author_id': 93399, 'author_profile': 'https://Stackoverflow.com/users/93399', 'pm_score': 3, 'selected': False, 'text': '<p>You can ask VS to compile multiple projects in parallel as well as compiling parallelly (!?) within a project.</p>\n\n<p>Tools > Options > Projects and Solutions > maximum number of parallel projects build.</p>\n\n<p>This will build C++ and C# in parallel as well!</p>\n'}, {'answer_id': 3357049, 'author': 'Olivier Dagenais', 'author_id': 98903, 'author_profile': 'https://Stackoverflow.com/users/98903', 'pm_score': 2, 'selected': False, 'text': '<p>Now that <strong>Visual Studio 2010</strong> has been released for a bit, consider upgrading to make use of the <code>parallelTestCount</code> attribute in MSTest\'s <code>.testsettings</code> file, as described at <a href="http://msdn.microsoft.com/en-us/library/ee921484.aspx" rel="nofollow noreferrer">How to: Run Unit Tests Faster Using a Computer with Multiple CPUs or Cores</a>.</p>\n\n<p>There are a few limitations, such as:</p>\n\n<ol>\n<li>Only simple unit tests are supported (i.e. excludes coded UI tests and ASP.NET-hosted tests)</li>\n<li>Tests must be thread-safe (all tests are run in the same process)</li>\n<li>You can\'t collect code coverage (among other data &amp; diagnostics) at the same time</li>\n</ol>\n\n<p>Example, using <strong>0</strong> to mean <strong>auto-detect</strong> (the default is <strong>1</strong>):</p>\n\n<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;\n&lt;TestSettings\n  name="Release"\n  id="{GUID}"\n  xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"&gt;\n  &lt;Description&gt;\n    These are default test settings for a local test run.\n  &lt;/Description&gt;\n  &lt;Execution parallelTestCount="0"&gt;\n    (...)\n  &lt;/Execution&gt;\n&lt;/TestSettings&gt;\n</code></pre>\n\n<p>A few blogs have noted that <strong>you might have to close and re-open your project</strong> for Visual Studio to notice you added/changed that attribute.  Also, if you edit the test settings file using the GUI, you\'ll probably have to re-add the <code>parallelTestCount</code> attribute.</p>\n'}, {'answer_id': 17818503, 'author': 'Co7e', 'author_id': 424111, 'author_profile': 'https://Stackoverflow.com/users/424111', 'pm_score': 2, 'selected': False, 'text': '<p>In case anyone comes across this old question, VS2012 introduced parallel builds as a <a href="http://visualstudiomagazine.com/articles/2012/03/01/more-power.aspx" rel="nofollow">standard feature</a>. Quote from the article:</p>\n\n<blockquote>\n  <p>Visual Studio 2010 included an option for "maximum number of parallel\n  project builds." Although there was no indication of any restriction,\n  this IDE option only worked for C++ projects. Fortunately, this\n  restriction no longer applies to Visual Studio 11. Rather, there\'s now\n  full support for parallel builds in other languages as well. To view\n  this, run a copy of Process Explorer at the same time a solution with\n  numerous projects is building. You\'ll see that multiple MSBuild\n  instances are created -- as many as specified in the "maximum number\n  of parallel project builds."</p>\n</blockquote>\n'}, {'answer_id': 48223770, 'author': 'Paul Zahra', 'author_id': 1611834, 'author_profile': 'https://Stackoverflow.com/users/1611834', 'pm_score': 0, 'selected': False, 'text': '<p>For Visual Studio 2010 Go to Tools > Options > Projects &amp; Solutions > Build and Run.</p>\n\n<p>You will then see an entry to enter a number for the \'maximum number of parallel project builds\'; my PC has an i7-3770 CPU, a Quad Core with HyperThreading, so it is set to 8.</p>\n\n<p>For information on different versions of Visual Studio go here and select your version: <a href="https://msdn.microsoft.com/en-us/library/cyhcc7zc(v=vs.100).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/cyhcc7zc(v=vs.100).aspx</a></p>\n\n<p>e.g. for Visual Studio 2010 this property only affects C++ builds: </p>\n\n<blockquote>\n  <p>Specifies the maximum number of Visual C++ projects that can build at the same time. To optimize the build process, the maximum number of parallel project builds is automatically set to the number of CPUs of your computer. The maximum is 32.</p>\n</blockquote>\n\n<p>But for Visual Studio it\'s for C++ and C#:</p>\n\n<blockquote>\n  <p>maximum number of parallel project builds\n  Specifies the maximum number of Visual C++ and Visual C# projects that can build at the same time. To optimize the build process, the maximum number of parallel project builds is automatically set to the number of CPUs of your computer. The maximum is 32.</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/53939', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1122/']