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

Solve inter-pool deadlocks #449

Merged
merged 2 commits into from Oct 6, 2017

Conversation

Projects
None yet
2 participants
@cuviper
Copy link
Member

cuviper commented Sep 25, 2017

Registry::in_worker() now calls a distinct Registry::in_worker_cross
when a WorkerThread is found for the current thread, but it's not
part of this Registry's pool. We use a new TickleLatch which will
awaken a pool when it's set. Then the current thread can go process
other work from its own pool, possibly going to sleep when idle, and
still be notified when the other pool finishes the new work.

Solve inter-pool deadlocks
`Registry::in_worker()` now calls a distinct `Registry::in_worker_cross`
when a `WorkerThread` *is* found for the current thread, but it's not
part of this `Registry`'s pool.  We use a new `TickleLatch` which will
awaken a pool when it's set.  Then the current thread can go process
other work from its own pool, possibly going to sleep when idle, and
still be notified when the other pool finishes the new work.

@cuviper cuviper requested a review from nikomatsakis Sep 25, 2017

@nikomatsakis nikomatsakis merged commit 05c8177 into rayon-rs:master Oct 6, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@cuviper cuviper deleted the cuviper:interpool branch Oct 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.