2 ms·
Consider the following scenario: Two threads both want to MMAP a file / catch SIGSEGV for different pieces of code. Moreover, these threads come from different
by rocqua 8y ago
Consider the following scenario:
Two threads both want to MMAP a file / catch SIGSEGV for different pieces of code.
Moreover, these threads come from different modules of a system maintained by different people.
All of a sudden, these modules become coupled because we need some system for delegation of signal handlers between them.
Or, we need to introduce a custom signal-handler module to deal with our delegation.
I would not call that 'playing nice with threads' nor would I call that sloppy thread programming.
- hyc_symas 8y agoYou're really just talking about poor practice in writing signal handlers. The signal API always tells you the previous value of a handler. Your own handlers should remember the previous value and call it if your own handler doesn't fully handle a signal it receives.