Sidebar – signal handling within the OS – polling not interrupts

Here, we do not intend to delve deep into the Linux kernel internal details of signal handling; rather, we'd like to make clear a common misconception hinted at earlier: handling signals is not at all like hardware interrupt handling. Signals are not interrupts, nor faults or exceptions; all of these— interrupts, traps, exceptions, faults—are raised by the PIC/MMU/CPU hardware on a computer. Signals are purely a software feature.

Delivering a signal to a process implies setting some members in the task structure of the task (in kernel memory), the so-called TIF_SIGPENDING bit, and the particular bit(s) representing the signal(s) in the task's sigpending set; this way, the kernel ...

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.