Yes, I vote for this one. "Spin" is too technical and could be not clear to not programmers, also "sleep" is technical jargon somehow, but the intuitive meaning is clear to everybody and is more or less correct.Don wrote: How about then using the same basic wording but making it boolean:
Idle Threads Sleep = true/false
use sleeping threads
Moderator: Ras
-
mcostalba
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: use sleeping threads
-
mcostalba
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: use sleeping threads?
I don't see the difference from just keeping the threads spinning.hgm wrote:You could for instance include a floating divide in the spinning loop..
In the "Idle Threads Sleep" case instead OS is free to reschedule another process or simply to go idle, IOW you have snappier UI and/or less fan noise. The latter is the main reason why we set it to true in the dev version: CPU is much less power hungry even with all cores used.
I'd even suggest to set "Idle Threads Sleep" to true as default for Android or anyhow where battery matters.
It is set to false for release because we have seen to lose some few ELO point vs spin case, but the lost is really small and marginal.
-
zullil
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: use sleeping threads
+1mcostalba wrote:Yes, I vote for this one. "Spin" is too technical and could be not clear to not programmers, also "sleep" is technical jargon somehow, but the intuitive meaning is clear to everybody and is more or less correct.Don wrote: How about then using the same basic wording but making it boolean:
Idle Threads Sleep = true/false
-
Don
- Posts: 5106
- Joined: Tue Apr 29, 2008 4:27 pm
Re: use sleeping threads?
My theory on this is not because it helps Stockfish but because it monopolizes the processors - which I think is what it should do if you are testing multiple programs on the same machine. But maybe it's a little of both.mcostalba wrote:I don't see the difference from just keeping the threads spinning.hgm wrote:You could for instance include a floating divide in the spinning loop..
In the "Idle Threads Sleep" case instead OS is free to reschedule another process or simply to go idle, IOW you have snappier UI and/or less fan noise. The latter is the main reason why we set it to true in the dev version: CPU is much less power hungry even with all cores used.
I'd even suggest to set "Idle Threads Sleep" to true as default for Android or anyhow where battery matters.
It is set to false for release because we have seen to lose some few ELO point vs spin case, but the lost is really small and marginal.
I cannot say for sure that spinning has an impact on cores being used by other programs, but I know that general processor usage has an impact on the other cores - although the newer chips have less of a problem with this. The reason is that some resources such as cache is shared between cores - even though an attempt is made to minimize the impact on performance for doing this.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
-
michiguel
- Posts: 6401
- Joined: Thu Mar 09, 2006 8:30 pm
- Location: Chicago, Illinois, USA
Re: use sleeping threads
I think you can use "combo" in the uci optionmcostalba wrote:Yes, this is a good suggestion, unfortunately the option is of boolean kind, IOW its value can be only true/falseDon wrote: Miguels suggestion here is the best in my opinion because it is explicit. There would be no ambiguity with "Idle Threads" = spin/sleep
option name Idle Threads type combo default spin var spin var sleep
You can convert it into a boolean internally.
If the most important criteria is to give the user something that can relate to, maybe an alternative to consider could be
"Idle Threads" = responsive/aggressive
or something like that. Maybe that will detach it from technical issues that they are not interested in. Or course "responsive" means "sleeping threads" here.
If you really want it boolean,
"SMP responsive mode" = on/off
I think that the lists in which the options are listed are more intuitive than the ones with on/off, but I guess this is a matter of taste.
Miguel
-
Matthias Gemuh
- Posts: 3245
- Joined: Thu Mar 09, 2006 9:10 am
Re: use sleeping threads
The lay man would think "responsive" meansmichiguel wrote:... Of course "responsive" means "sleeping threads" here.
...
Miguel
"able to respond, therefore NOT sleeping".
Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
http://www.chess.hylogic.de
-
Graham Banks
- Posts: 44799
- Joined: Sun Feb 26, 2006 10:52 am
- Location: Auckland, NZ
Re: use sleeping threads
Correct.Matthias Gemuh wrote:The lay man would think "responsive" meansmichiguel wrote:... Of course "responsive" means "sleeping threads" here.
...
Miguel
"able to respond, therefore NOT sleeping".
Matthias.
gbanksnz at gmail.com
-
Modern Times
- Posts: 3759
- Joined: Thu Jun 07, 2012 11:02 pm
Re: use sleeping threads
What a mess....
Idle Threads Sleep = true/false
Is clear enough, and the parameter can be explained in the readme file. Personally I am not clear on what effect this has on the other engine when playing ponder off games. And what the default behaviour is for other engines
Idle Threads Sleep = true/false
Is clear enough, and the parameter can be explained in the readme file. Personally I am not clear on what effect this has on the other engine when playing ponder off games. And what the default behaviour is for other engines
-
syzygy
- Posts: 5787
- Joined: Tue Feb 28, 2012 11:56 pm
Re: use sleeping threads
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.
-
Don
- Posts: 5106
- Joined: Tue Apr 29, 2008 4:27 pm
Re: use sleeping threads
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.
The experiment you can do on a quad to see this is to run a chess program on two threads and take some sort of timing. Then try the same experiment but do 2 identical timings simultaneously. You will see that these timings go more slowly because all 4 cores are sharing resources. So it's best in a competitive situation to try to keep all the cores you have been allocated busy doing something meaningful - not just for your benefit but to keep the opponent program from getting resources that belong to you.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.