Skip to content

Add support for strand-schedulers #285

Open
@lewissbaker

Description

@lewissbaker

Some algorithms can have more efficient implementations if they know that the scheduler that they are scheduling work on can only ever execute one thing at a time. Algorithms can potentially avoid needing to perform synchronization if this is the case.

However, we don't yet have any way of querying on a scheduler whether tasks scheduled on that scheduler can potentially execute concurrently or not.

To facilitate this we should provide such a query. This could either take the form of an is_strand query on the scheduler, or potentially a more general max_concurrency query, which callers can then check to see if it's equal to 1.

There may be some cases where a particular algorithm requires a strand-scheduler. We should also consider adding an adapter for a scheduler that returns a new scheduler that is guaranteed to be a strand-scheduler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    designdiscussionWe need to talk about this; there's nothing actionable here yetenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions