The first thread holds a key (mutex) for the "bestmove" output of the second thread. It releases the key only after receiving "stop" or "ponderhit". That way, the engine never wastes cycles because it gets blocked by a mutex.
Miguel
Desperado wrote:[d]5k2/1p3pb1/p2p4/5p1P/b1P5/P5r1/3q4/5R1K b - - 0 36
well, i was just in mood to watch my engine playing some bullet games.
When the above position occured, Nemo(black pieces) already looped over all iterations (in ponder-mode)
It is forced to send a move when all iterations are done, which was
of course ignored by the gui, and so Nemo(with 30s, very painful) lost on time because
ponderhit jumps into no-where so to say. (dead lock...).
Or in other words, ponder-search was finished before Sjeng finished the
search process for Kg1-Kh1, so before the move was played.
i am not sure how to handle that case at first glance, when pondering.
Of course i can reserve the best move and switch to some kind of idle-loop, until the ponderhit command is received or whatever.
now a simple question, what are your engines doing in that case ?
Michael