- while (!exit)
- {
- std::unique_lock<Mutex> lk(mutex);
-
- while (!searching && !exit)
- sleepCondition.wait(lk);
-
- lk.unlock();
-
- if (!exit && searching)
- search();
- }
-}
-
-
-// MainThread::idle_loop() is where the main thread is parked waiting to be started
-// when there is a new search. The main thread will launch all the slave threads.
+ // If OS already scheduled us on a different group than 0 then don't overwrite
+ // the choice, eventually we are one of many one-threaded processes running on
+ // some Windows NUMA hardware, for instance in fishtest. To make it simple,
+ // just check if running threads are below a threshold, in this case all this
+ // NUMA machinery is not needed.
+ if (Options["Threads"] >= 8)
+ WinProcGroup::bindThisThread(idx);