Skip to content
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

Make sure ParBridge threads consume all items after done #849

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Apr 21, 2021

We have the done flag to indicate when the bridged iterator is out of
items, but there may still be items left in the parallel deque as well!
Threads should check both, in that order, otherwise they may drop out of
the bridge party while there's still work to do.

Fixes #848.

We have the `done` flag to indicate when the bridged iterator is out of
items, but there may still be items left in the parallel deque as well!
Threads should check both, in that order, otherwise they may drop out of
the bridge party while there's still work to do.
@cuviper
Copy link
Member Author

cuviper commented Apr 21, 2021

cc @ambiso -- this corrects your MWE from #848 on my system, but I'd appreciate if you could test it yourself, and also with your original code.

@ambiso
Copy link

ambiso commented Apr 22, 2021

I've tested the MWE and cannot reproduce the bug anymore! 🎉
My original code is structurally identical, so it shouldn't make a difference.

@nikomatsakis
Copy link
Member

bors r+

@bors bors bot merged commit 378d955 into rayon-rs:master Apr 28, 2021
@cuviper cuviper deleted the bridge-races branch February 25, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ParBridge using too few threads concurrently
3 participants