driver: more reasonable thread wait timeout on Windows. #2339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It used to be 5ms, which might not be long enough in some cases for the
thread to exit well, but then when set to 5000 (5s), it would slow down
any program depending on OpenBlas.
Let's just set it to 50ms, which is at least 10 times longer than
originally, but still reasonable in case of failed thread termination.
This is a followup of #2314. After providing a test installer of GIMP with patched OpenBLAS, reporters could confirm crashes were gone. On the other hand, it seems GIMP got extra slower on startup on Windows (worse reports were telling of GIMP startup hanging for more than 10 minutes!). I am unsure when this code in
blas_server_win32.c
is called exactly, and how many threads it creates and it awaits for termination (and I'd like to not have to spend too long on this! 😛), but I figured the timeout we passed to 5 seconds is the culprit. After testing, lowering it down to 50ms (which is still 10 times longer than the original 5ms, but at least reasonable wait in case of failure), people confirmed GIMP startup is good again and crash is still gone.Anyway I think that the other part of the previous patch (not terminating a thread which was successfully terminated by itself) was the most important part of the fix.