Handle Windows Processors Groups

Under Windows it is not possible for a process to run on more than one
logical processor group. This usually means to be limited to use max 64
cores. To overcome this, some special platform specific API should be
called to set group affinity for each thread. Original code from Texel by
Peter sterlund.

Tested by Jean-Paul Vael on a Xeon E7-8890 v4 with 88 threads and confimed
speed up between 44 and 88 threads is about 30%, as expected.

No functional change.
This commit is contained in:
Marco Costalba
2016-11-22 07:41:46 +01:00
parent 6036303bb6
commit 0d9a9f5e98
3 changed files with 120 additions and 0 deletions

View File

@@ -96,6 +96,8 @@ void Thread::start_searching(bool resume) {
void Thread::idle_loop() {
WinProcGroup::bindThisThread(idx);
while (!exit)
{
std::unique_lock<Mutex> lk(mutex);