Skip to content

Implement true preemption for managed code #2066

@sporksmith

Description

@sporksmith

A thread that never makes any syscalls will stop a Shadow simulation from making progress.

We haven't encountered this in practice, but have encountered other "busy loops" that wait for another thread to do something. Our new feature for modeling latency of non-blocking syscalls helps us escape most such loops, and arguably it'd be pretty poor code that didn't have some kind of timeout, which would imply a system call to check the time.

Still, it's not too far-fetched to imagine, e.g. spawning a thread and then busy-waiting for the new thread to modify an atomic in memory. Such code probably ought to have a timeout or at least a sched_yield, but undoubtedly code exists with neither.

This is currently low priority, but let's track any real-world instances of this problem that we do find here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugError or flaw producing unexpected results

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions