]> git.sesse.net Git - stockfish/commit
Rewrite how commands from GUI are read
authorMarco Costalba <mcostalba@gmail.com>
Sat, 5 Nov 2011 06:53:19 +0000 (07:53 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 5 Nov 2011 07:35:17 +0000 (08:35 +0100)
commit2617aa415e94eeccf4a7e77aec0f55cebb351366
tree738cb840e748083373ce1daa1b92e445021f0965
parent22b9307aba0f78aa92abcf85e807af8b64011c7a
Rewrite how commands from GUI are read

Instead of polling for input use a dedicated listener
thread to read commands from the GUI independently
from other threads.

To do this properly we have to delegate to the listener
all the reading from the GUI: while searching but also
while waiting for a command, like in std::getline().

So we have two possible behaviours: in-sync mode, in which
the thread mimics std::getline() and the caller blocks until
something is read from GUI, and async mode where the listener
continuously reads and processes GUI commands while other
threads are searching.

No functional change.

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