-
Notifications
You must be signed in to change notification settings - Fork 254
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
deadlock[BUG] #100
Comments
Thanks for opening this issue, @wjr-z. I will take a look and try to fix this. However, I'm putting this at a lower priority compared to other issues, because this only happens if you call I can see that @Antares0982 has written a workaround, but his fork seems to work differently from mine, so I'm not sure it translates back. Also, his solution seems to be a bit complicated, and I hope there may be an easier way to solve this. I'm open to suggestions regarding simple solutions! |
Add fflush(stdout); after the first @bshoshany the 32 times in a row just makes it happen more quickly to make it repeatable. If you just change the 32 to 2 it'll just take a more iterations (so change 1e3 to 1e6). If you remove the I strongly suspect this has the same root cause as #107 @bshoshany I understand you have more pressing things than working on free software (like teaching) but let's avoid terms like "lower priority" for things that literally break your users' software. These deadlocks are roughly one in a thousand, and that is not rare. |
@alugowski thanks for the information. I said it's lower priority because the code appears to be very artificial and I don't see this issue breaking any real-life software, but if you believe this can also happen in real-life applications, I will move this to a higher priority. Like I said in #107, it's important to me that the thread pool is "mathematically" free of deadlocks, even in artificial examples like this one, so I do intend to work hard on this until I find a solution. |
Closed as resolved by PR #108 (will be included in v3.4.0). |
Deadlock caused by reset
It is necessary to lock running during reset
Otherwise, if the thread is in the process of judging the end of running, but has not yet waited, the running has been modified and has been notified_ All, it will deadlock
The probability of deadlock is very low, but it may still occur.
On my local machine, a deadlock occurred when using GCC12.2 for testing
The text was updated successfully, but these errors were encountered: