|
|
|
|
|
by the_mitsuhiko
3583 days ago
|
|
The only thing you can do from a signal handler is flipping a static and only one signal handler can be set. Good luck making this reusable. In fact, I challenge you to solve the problem "spawn process; waitpid for 15 seconds; otherwise kill hard" in Rust (or C++ if you feel like) on POSIX once with threads and once without threads by sticking to what's permitted in the standard and so that multiple processes can be waited for. Then also measure CPU impact :) |
|
This is false, you can call any async signal safe function. Incidentally write is one of them.
Another trick is the close-on-exit pipe.