-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Nesting task pool's Scopes #4301
Copy link
Copy link
Closed
Labels
A-TasksTools for parallel and async workTools for parallel and async workC-FeatureA new feature, making something new possibleA new feature, making something new possible
Description
What problem does this solve or what need does it fill?
Currently scopes cannot be nested, which means tasks spawned in a scope cannot spawn more tasks.
What solution would you like?
Modify Scope definition (for wasm and non-wasm) to use interior mutability.
That way many spawn-able scopes can be passed deeper.
This in both current cases means wrapping the results vector with a thread-safe interior mutability type, like Mutex or RwLock.
What alternative(s) have you considered?
A alternative to scopes mentioned in #4287 could cover some of the nesting use cases.
Additional context
This solution was used in other crates such as crossbeam
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-TasksTools for parallel and async workTools for parallel and async workC-FeatureA new feature, making something new possibleA new feature, making something new possible