Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call the _is_ready() function before sending any command #92

Open
johndoknjas opened this issue Aug 26, 2024 · 0 comments · May be fixed by #89
Open

Call the _is_ready() function before sending any command #92

johndoknjas opened this issue Aug 26, 2024 · 0 comments · May be fixed by #89

Comments

@johndoknjas
Copy link

johndoknjas commented Aug 26, 2024

In order to prevent lagging. E.g., one could call a function many times, where this function sends an expensive command to Stockfish. The function calls would be relatively quick, but they would finish before Stockfish can process all the commands. This will make subsequent commands lag.

So calling _is_ready() before sending a command ensures Stockfish doesn't get bogged down working through multiple commands. And _is_ready() itself is quite fast (hundredths of a millisecond on my computer). _is_ready() can also be sent after certain expensive commands, assuming that they don't output to stdout (since _is_ready will clear this).

@johndoknjas johndoknjas changed the title Call the ._is_ready() function before sending any command Call the ._is_ready() function before (or after?) sending any command Aug 26, 2024
@johndoknjas johndoknjas linked a pull request Aug 26, 2024 that will close this issue
@johndoknjas johndoknjas changed the title Call the ._is_ready() function before (or after?) sending any command Call the _is_ready() function before (or after?) sending any command Aug 26, 2024
@johndoknjas johndoknjas changed the title Call the _is_ready() function before (or after?) sending any command Call the _is_ready() function before sending any command Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant