Alternative signal-handling techniques

So far, in the previous chapter as well as this one on signaling, we have seen and learned to use several techniques with regard to asynchronously trapping and working with signals. The essential idea is this: the process is busy performing its work, running its business logic; a signal suddenly arrives; nevertheless, the process must handle it. We saw in quite some detail how one leverages the powerful sigaction(2) system call to do so.

Now, we look at signal handling in a different manner: synchronously handling signals, that is, how to have the process (or thread) wait for (block upon) signals and handle them as they arrive.

The chapters to come on multithreading will provide some use cases of the ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.