SA_IMMUTABLE and the hazards of messing with signals
SA_IMMUTABLE and the hazards of messing with signals
Posted Dec 20, 2021 11:15 UTC (Mon) by roc (subscriber, #30627)In reply to: SA_IMMUTABLE and the hazards of messing with signals by marcH
Parent article: SA_IMMUTABLE and the hazards of messing with signals
I don't agree with this at all. Signal-safety and thread-safety are actually very different concepts with very different constraints. For example, you can make code thread-safe by using mutexes, but that actually doesn't work at all for signal handlers because you will instantly deadlock if a signal handler tries to acquire a mutex held by the thread it interrupted (assuming non-reentrant mutexes; if your mutexes are reentrant the situation is even worse since you won't get mutual exclusion).
Posted Dec 20, 2021 16:14 UTC (Mon)
by marcH (subscriber, #57642)
[Link]
SA_IMMUTABLE and the hazards of messing with signals