Selective readingAndrewGrant wrote: ↑Fri Aug 28, 2020 6:54 pmFrom the UCI spec:lucasart wrote: ↑Thu Aug 27, 2020 7:09 am Extra thread is just correct software design, but is not mandatory (you can poll() every few nodes and read input sequentially). The reason for this is that the engine must be responsive while searching. At the very least, it must be responsive to "isready", "stop", and "ponderhit". Ideally the protocol should also state that these are the only commands that a GUI is allowed to send to a searching engine.Those things are in conflict. I refuse to respond with isready while searching.this is used to synchronize the engine with the GUI. When the GUI has sent a command or multiple commands that can take some time to complete, this command can be used to wait for the engine to be ready again or to ping the engine to find out if it is still alive. E.g. this should be sent after setting the path to the tablebases as this can take some time. This command is also required once before the engine is asked to do any search to wait for the engine to finish initializing. This command must always be answered with "readyok" and can be sent also when the engine is calculating in which case the engine should also immediately answer with "readyok" without stopping the search.

which is not contradicting (but rather reinforcing):this command can be used to wait for the engine to be ready again or to ping the engine to find out if it is still alive
Besides, this is logical and necessary. How else would you implement ping in a GUI ?This command must always be answered with "readyok" and can be sent also when the engine is calculating in which case the engine should also immediately answer with "readyok" without stopping the search.
In c-chess-cli, I don't ping, because I'm lazy. All I have is a timeout mechanism to escape blocking I/O, because str_getline() will block until a full line is read. And the searching engine can spend an unbounded amount of time before writing anything to stdout...
But ping is necessary in any good GUI (or CLI). If the engine has 2h on the clock, and is hanging already, a ping could detect it quasi immediately (modulo time out margin), whereas waiting for the clock to time out is another 2h away!