Closed
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