]> git.sesse.net Git - stockfish/commit - src/movepick.cpp
Don't fear races when are harmless
authorMarco Costalba <mcostalba@gmail.com>
Sat, 8 Feb 2014 12:07:57 +0000 (13:07 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 8 Feb 2014 12:07:57 +0000 (13:07 +0100)
commit0a1092f64eb9eb232094036086fc5c98ed1f3c46
tree10753c5c7826563899d19266884d8a26ac2d5c3b
parent399968f1d086fae1da777ca18671b996a3d6ba9d
Don't fear races when are harmless

Actually race conditions do exist in an engine, just
think for a moment to TT concurrent access. Racy code
is not a problem per se, if the consequences are well
known and correctly handled.

In case of TT access we ensure that the TT move is validated
before to be tried, here we just retry the same move in less
that 1 case out of a million: this is totally harmless considering
that very probably the second time the move is tried we get
immediately a TT hit and search quickly returns.

So we simplify the code for no harm.

No fuctional change (in single thread case)
src/movepick.cpp