-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Suppose I start K threads and spawn N > K tasks. Suppose each of those tasks calls Pool::scoped() to run scheduler callbacks that each spawn additional tasks in their scopes. It seems to me this can easily deadlock, since we could have all K threads stopped waiting in a Scope::join() with no threads able to run the scoped tasks that are being waited for. Right?
If so, then it's dangerous to call Scope::join() or Pool::scoped() from a Pool thread, and Scope::recurse() is always dangerous.
Maybe this could be fixed by making the waiting thread in a Scope::join() available to run pending tasks?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels