Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Heretical opinion: signal handler activations should count as separate threads for the purposes of recursive locking.


How would be done without introducing deadlock?


You’d get a deadlock, absolutely. But I’m fine with that: if the thread wants to access some state protected by a mutex, then while holding it (effectively) spawns a signal handler activation and waits for it to complete, and the signal handler tries to accept some state protected by the same mutex, then the program has just deadlocked (mutex → signal handler → mutex) and deserves to hang (or die, as this is a very simple situation as far as deadlock detection goes). That’s in any case better than corrupted state.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: