-
Notifications
You must be signed in to change notification settings - Fork 268
Implement true preemption for managed code #2066
Description
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.