]> git.sesse.net Git - stockfish/commit
Fix some races and clarify the code
authorMarco Costalba <mcostalba@gmail.com>
Sun, 6 Aug 2017 11:43:02 +0000 (04:43 -0700)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 10 Aug 2017 17:19:56 +0000 (10:19 -0700)
commit750dfa0521472e86c67f870fe7ca413d670cafe2
tree5c919d0ce72ddb834794518baa65b0b4efc01cba
parentdbc984d9f87ba79db3c7802310450f60e95e89e4
Fix some races and clarify the code

Better split code that should be run at
startup from code run at ucinewgame. Also
fix several races when 'bench', 'perft' and
'ucinewgame' are sent just after 'bestomve'
from the engine threads are still running.

Also use a specific UI thread instead of
main thread when setting up the Position
object used by UI uci loop. This fixes a
race when sending 'eval' command while searching.

We accept a race on 'setoption' to allow the
GUI to change an option while engine is searching
withouth stalling the pipe. Note that changing an
option while searchingg is anyhow not mandated by
UCI protocol.

No functional change.
src/benchmark.cpp
src/main.cpp
src/search.cpp
src/uci.cpp