|
|
|
|
|
by wahern
2952 days ago
|
|
It's a shame this experimental Google proposal for userspace thread scheduling never got picked up: https://blog.linuxplumbersconf.org/2013/ocw/system/presentat... The basic API (see page 17) consisted of: pid_t switchto_wait(timespec *timeout)
- Enter an 'unscheduled state', until our control is
reinitiated by another thread or external event (signal).
void switchto_resume(pid_t tid)
- Resume regular execution of tid
pid_t switchto_switch(pid_t tid)
- Synchronously transfer control to target sibling
thread, leaving the current thread unscheduled.
The key abstraction is switchto_switch, which explicitly transfers control to another thread, leaving the current thread quiescent. It's analogous to setcontext(3) or longjmp(3). |
|