My question is just what the title says (for Unix/Linux only). I assume that user calls to std::raise
and std::abort
are always executed in the same thread that made the call, but, I have some questions about asynchronous and kernel routines sending signals...
- If I send a signal from command line to a thread pid, will the thread treat the signal or it will be treated by the main thread depending on which signal has been sent?
- If
malloc
detects some heap corruption, will the signal be sent to the main thread or will be executed as well in the thread that calledmalloc
? The same questions applies to bugs generating SIGFPEs or SIGSEGVs. - There are signal that are always treated by the main thread regardless which thread causes it, or to which pid was sent to?
- Which other situations are worth mention in multithread contexts?