C++ How to limit visual studios multi-processor co

2020-05-25 05:43发布

Every time I compile using visual studio the rest of my computer crawls because visual studio is hogging all the processors. Is there a way to limit the number of processors that visual studio is using so I can still get some work done during the compilation time?

By the way, I am using visual studio 2013 and 2015 and programming in C++.

Thanks!

7条回答
Rolldiameter
2楼-- · 2020-05-25 06:38

A more optimal answer comes from Mikhail Virovets at https://developercommunity.visualstudio.com/comments/497084/view.html

Decrease the compiler process priority to below normal. This means it will use as much CPU as possible but without interfering with other things you're trying to use.

Define a registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cl.exe\PerfOptions

Then create a DWORD value named CpuPriorityClass = 5 (5 means "below normal").

Note that this affects all processes named "cl.exe".

查看更多
登录 后发表回答