Can preemptive multitasking of native code be implemented in user space on Linux?
问题 I'm wondering if it's possible to implement preemptive multitasking of native code within a single process in user space on Linux. (That is, externally pause some running native code, save the context, swap in a different context, and resume execution, all orchestrated by user space but using calls that may enter the kernel.) I was thinking this could be done using a signal handler for SIGALRM , and the *context() family but it turns out that the entire *context() family is async-signal