3 ms·
There were differences between BSD and SYSV signal handling that were problematic in writing portable applications. https://pubs.opengroup.org/onlinepubs/00960
by chasil 2y ago
There were differences between BSD and SYSV signal handling that were problematic in writing portable applications.
https://pubs.opengroup.org/onlinepubs/009604499/functions/bsd_signal.html https://pubs.opengroup.org/onlinepubs/009604499/functions/bs...
It's important to remember that code in a signal handler must be re-enterant. "Nonreentrant functions are generally unsafe to call from a signal handler."
https://man7.org/linux/man-pages/man7/signal-safety.7.html https://man7.org/linux/man-pages/man7/signal-safety.7.html
- convolvatron 2y agoreentrancy is not sufficient here - at least that provided by mutex style exclusion. the interrupted thread may have actually been the one holding the lock, so if the signal handler enters a queue to wait for it, it may be waiting quite a while
- tedunangst 2y agoThat's why the word reentrant is used, not thread safe.