The issue
So, what's the problem? There is a significant difference in how we handle signals in MT apps. Why? The fact is that the traditional manner of handling signals does not really mix well with the pthreads framework. If you can avoid the usage of signals in your MT app, please do so. If not (often the case in real-world MT apps), then read on—we shall detail how to handle signals when within an MT application.
But why is signaling now an issue? It's quite straightforward: signals were designed and meant for the process model. Consider this: how does one process send a signal to another process? It's quite clear - using the kill(2) system call:
int kill(pid_t pid, int sig);
Clearly, the first parameter, pid, is the PID of the process ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access