-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Is uiThread required to avoid data races? #2299
Comments
the rationale for uiThread is in the commit message 750dfa0 . If I understand correctly to allow certain commands while search is going on. That's a bit of a grey area, since UCI suggests that this is not conforming. So, the one at line 196 would be a feature, while the one at line 70 is OK for conforming uci commands. This is tricky code, I would recommend to compile with the sanitize=thread option, and see what happens when issuing UCI commands during search. |
yes, I did a quick check, and even with this uiThread in place, things are not race free issuing an eval during an ongoing search. It might have been a partial fix, but not the full fix. In that case, it is not clear if there is any benefit from the code. |
With the current questions and issues around threading, I had a look at #2299. It seems there was a problem with data races when requesting eval via UCI while a search was already running. To fix this an extra thread uithread was created, presumably to avoid an overlap with Threads.main() that was causing problems. Making this eval request seems to be outside the scope of UCI, and @vondele also reports that the data race is not even fixed reliably by this change. I suggest we simplify the threading here by removing this uithread and adding a comment signaling that user should not request eval when a search is already running. Closes #2310 No functional change.
this issue can be closed now. |
@niklasf Merged to our fork at https://travis-ci.org/ddugovic/Stockfish/builds/600211626 |
Thanks all. |
Apologies if #1990 was closed intentionally. If so, I'd appreciate brief explanantion.
uiThread
is used here (a):Stockfish/src/uci.cpp
Line 196 in 6514500
But not here (b):
Stockfish/src/uci.cpp
Line 70 in 6514500
This means that there's either a data race in (b), or an upportunity to simplify away
uiThread
in (a). (Or a third option, that I am missing). Can anyone figure out which it is?The text was updated successfully, but these errors were encountered: