]> git.sesse.net Git - stockfish/commit
Make reduction search code SMP-friendly
authorJoona Kiiski <joona.kiiski@gmail.com>
Sun, 17 Jan 2010 17:14:23 +0000 (19:14 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 18 Jan 2010 08:11:58 +0000 (09:11 +0100)
commit419c5b69caa2918f9cb74d6ec71d790bc276b424
treea3d15ce3484f89c5b5c5818f88750870de01c61d
parent72e1e9b986fc4c656c3a3db24e5504e3edbb63cc
Make reduction search code SMP-friendly

In sp_search_pv() we do a LMR search using sp->alpha, at the end
we detect a fail high with condition (value > sp->alpha), but if
another thread has increased sp->alpha during our LMR search we
could miss to detect a fail high event becasue value will be equal
to old alpha and so smaller then new one.

This patch fixes this SMP-bug and changes also the non SMP versions
of the search to keep code style in sync.

Bug spotted by Bruno Causse.

No functional change (for single CPU case)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp