Share via


Multiprocessor Builds

Multiprocessor builds enable you to build multiple projects concurrently on computers that have more than one CPU. For example, if your computer has two CPUs, then this feature allows you to build up to two projects at the same time.

To optimize the build process, Visual Studio automatically sets the maximum number of concurrent builds equal to the number of CPUs on your computer. You can modify this setting by changing the value of the Maximum number of parallel project builds property in the Build and Run property page of the Options dialog box. For more information, see How to: Set the Number of Concurrent Builds for Multiprocessor Builds.

Running Multiprocessor Builds

You can run multiprocessor builds from the IDE or command line. To build from the command line, use either VCBUILD or DEVENV. For tasks that demonstrate these concepts, see:

Multiprocessor Build Output

When you run multiprocessor builds, the project system assigns a number to each project configuration included in the build, which is followed by a right angle-bracket. This prompt precedes each status message for every build step.

The following example build output is the result of a multiprocessor build:

1>------ Build started: Project: ConsoleApp2, Configuration: Debug Win32 ------
2>------ Build started: Project: ConsoleApp1, Configuration: Debug Win32 ------
1>Compiling...
2>Compiling...
1>stdafx.cpp
2>stdafx.cpp
2>Compiling...
1>Compiling...
2>AssemblyInfo.cpp
1>AssemblyInfo.cpp
1>ConsoleApp2.cpp
2>ConsoleApp1.cpp
2>Generating Code...
1>Generating Code...
1>Compiling resources...
2>Compiling resources...
2>Linking...
1>Linking...
2>Build log was saved at "file://d:\Documents and Settings\username\My Documents\Visual Studio\Projects\Demo\ConsoleApp1\Debug\BuildLog.htm"
2>ConsoleApp1 - 0 error(s), 0 warning(s)
2>
1>Build log was saved at "file://d:\Documents and Settings\username\My Documents\Visual Studio\Projects\Demo\ConsoleApp2\Debug\BuildLog.htm"
1>ConsoleApp2 - 0 error(s), 0 warning(s)
1>
---------------------- Done ----------------------

    Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped

The multiprocessor build output illustrates that build steps for multiple projects can spawn concurrently. This behavior is in contrast to non-multiprocessor builds, which do not start build processes for other projects until the build process for the current project has been completed.

The following example build output is the result of a non-multiprocessor build:

------ Build started: Project: ConsoleApp1, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
Compiling...
AssemblyInfo.cpp
ConsoleApp1.cpp
Generating Code...
Compiling resources...
Linking...
Build log was saved at "file://d:\Documents and Settings\username\My Documents\Visual Studio\Projects\Demo\ConsoleApp1\Debug\BuildLog.htm"
ConsoleApp1 - 0 error(s), 0 warning(s)

------ Build started: Project: ConsoleApp2, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
Compiling...
AssemblyInfo.cpp
ConsoleApp2.cpp
Generating Code...
Compiling resources...
Linking...
Build log was saved at "file://d:\Documents and Settings\username\My Documents\Visual Studio\Projects\Demo\ConsoleApp2\Debug\BuildLog.htm"
ConsoleApp2 - 0 error(s), 0 warning(s)

---------------------- Done ----------------------

    Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped

See Also

Reference

How Can I Build Faster?