]> git.sesse.net Git - stockfish/commitdiff
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)
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)


No differences found