This is how early user-level threading libraries like GNU Pth added preemption on top of cooperative scheduling, and the async-signal-safety constraint you'll hit is a real, frequently-violated rule: calling malloc() or printf() inside a signal handler is a documented source of deadlocks and heap corruption in production C code, which is exactly why POSIX maintains an explicit async-signal-safe function list.