-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Stageless: avoid deadlock in TaskPool::scope
by polling all tasks
#7492
Conversation
TaskPool::scope
by polling all tasks
Example |
some API is still relying on that
I did some preliminary checking with In general I'm in favor of something like this. It's pretty close to what I was thinking of for the "fair polling" alternative I mentioned in the other pr. |
Thinking about this some more and I'm not sure this is the right approach. This doesn't properly cooperate with the tasks. The version of get_results on main will wait for the task that it is awaiting to complete before waking. This version doesn't do that. It will constantly poll the tasks. We probably want to write a custom future that can properly wait for a wake signal from all the tasks before rechecking things. |
Yeah I'm also not a fan of the constant polling. Feels too much like we're circumventing the executor. |
@maniwani shall we close this out for now? |
Sure. |
Objective
Replace #7448 with the "fair polling" alternative it mentioned, so that we can continue to mirror
std::thread::scope
(i.e. keep "nested scope spawns").Solution