Skip to content

Nesting task pool's Scopes #4301

Closed
Closed
@MiniaczQ

Description

@MiniaczQ

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TasksTools for parallel and async workC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions