-
Notifications
You must be signed in to change notification settings - Fork 546
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
race condition in workpool #70
Comments
Hi Paolo, I'm not sure I see exactly what the problem is with the current code. What race condition are you seeing? |
Hi Max,
and
could be execute in wrong order and wp->end_count will have wrong value. I try to understand what you want to do and my idea is to wait that all threads be in a wait state
at the end of create and for extra security lock endcound access
I hope I have been clear enough. Best |
Hi All,
I suggest to wait until all threads completed startup before returning in workerpool_create function, adding
and in workerpool_run function, wp->end_count editing should be protected (ok... this problem should not happen), inserting it after mutex lock:
Best
Paolo
The text was updated successfully, but these errors were encountered: