The spinning idle threads make it look like all threads are 100% busy all the time, even if they have nothing useful to do.Don wrote:It's only in ponder mode where this can be a factor - but I'm not even sure of that. In ponder mode if you do not utilize all your threads you (at least slightly) relieve the working threads of the competing program of the burden of sharing resources. However I don't know if a spinning lock has enough impact or even any impact on this since it is not heavily competing for any resources that are shared.syzygy wrote:Unless the other engine "cheats" by somehow using the cpu in non-ponder mode when it is not its turn, the option will have no effect whatsoever on the other engine.Modern Times wrote:Personally I am not clear on what effect this has on the other engine when playing ponder off games.
In non-ponder mode, the Stockfish threads, and the threads of any other engine that is not buggy, will sleep (and therefore not use any resources) when the other side is to move.
But the analysis is indeed not so simple. In ponder mode, Stockfish might actually gain from Use Sleeping Threads set to true. The reason is that with idle threads sleeping, the OS will not subtract the idle time from Stockfish's cpu quota. If the OS awards 50% of the available cpu time to Stockfish and 50% to the other engine, with idle threads sleeping the whole 50% is used for searching. On the other hand if idle threads spin instead of sleep, part of Stockfish's 50% is wasted on spinning.
The above assumes that the number of search threads for each engine is equal to the number of physical cores, and the cpu has no HT. For other configurations, the analysis is different (and depends on how search threads of each engine are distributed over the logical hyperthreads of the various cores).