Stageless: avoid deadlock in TaskPool::scope by polling all tasks#7492
Stageless: avoid deadlock in TaskPool::scope by polling all tasks#7492maniwani wants to merge 12 commits intobevyengine:mainfrom
TaskPool::scope by polling all tasks#7492Conversation
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