-
Notifications
You must be signed in to change notification settings - Fork 84
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
Join waves #89
Join waves #89
Conversation
…exit together even if the pool is already processing new jobs
I read this through a couple times, but I'm a little confused what the issue is without these changes. Is the problem when multiple threads try to |
I am sorry it took me so long to respond, RustFest is around the corner. /// more than one thread does this
pool.join();
pool.execute(move || { /* second wave of jobs */ }); Before this PR I noticed different behavior with
After this patch the submitter threads have the generation locally and will exit the Do you think the docs are clear enough? I can also squash the commits a bit if you like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, great job tracking this down @dns2utf8! i think your solution makes sense here, unblocking all threads waiting to be join
ed at once.
on a side note, i've been pretty busy lately (hence me taking a long time to review this). if you'd like, since you're doing most of the work for this crate nowadays, if you're comfortable with your changes, you can merge PRs without my approval. time permitting, i'm still happy to do reviews if you still want to ping me on PRs
i just gave you publishing rights for this crate if you want to try merging and publishing. let me know if you have any thoughts or need any help!
hey @frewsxcv Thank you! I am honored 😄 bors r+ |
🔒 Permission denied Existing reviewers: click here to make dns2utf8 a reviewer |
bors try |
🔒 Permission denied Existing reviewers: click here to make dns2utf8 a reviewer |
just added you, want to try again? |
bors r+ |
89: Join waves r=dns2utf8 a=dns2utf8 When I talked about the threadpool at the Zürichsee meetup somebody came up with a problem when multiple threads join on a pool. The scenario is joining threads should not be stuck once their wave of joins has completed. So once one thread joining on a pool has succeded other threads joining on the same pool must get out even if the thread is used for other jobs while the first group is finishing their join
Cool it works. Thank you 😄 |
When I talked about the threadpool at the Zürichsee meetup somebody came up with a problem when multiple threads join on a pool.
The scenario is joining threads should not be stuck once their wave
of joins has completed. So once one thread joining on a pool has
succeded other threads joining on the same pool must get out even if
the thread is used for other jobs while the first group is finishing
their join