Skip to content

Scheduler progress sense #7889

Closed
Closed
@bblum

Description

@bblum

The new runtime should be able to figure out (a) when all tasks are blocked, in which case it should report a deadlock, and (b) when a task is stuck in a "tight" infinite loop (i.e., not hitting the scheduler). The former can be done precisely; the latter will probably have to be done heuristically with some sort of watchdog thread. This maybe should be two different bugs.

The former will work with 2 global reference counts - one which tracks the number of non-sleeping schedulers, and one which tracks the number of tasks blocked on I/O. When the last scheduler goes to sleep, if the I/O-blocking refcount is zero, it means all tasks are either exited or blocked on pipes. If the latter, the runtime should emit a "your tasks deadlocked and now the process is hanging" message and exit. This will build on the refcounts we'll probably use for #7702.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-concurrencyArea: ConcurrencyA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions