Signal as interrupt
- Signals disrupt your program in addition to being instructive.
- For example, one of the threads in your application must briefly switch to signal handler mode in order to process a signal.
- As of the Linux kernel version 2.6, it should be noted that most signals only interrupt one thread, as opposed to the previous practice of interrupting the entire application.
- Additionally, a signal handler itself may be halted by a different signal.
Signal Handling In Linux Through The signal() Function
A signal is a message or notification issued to your program by the operating system or another application (or one of its threads). Each signal is assigned a number between 1 and 31. Signals are devoid of argument, and most of the time, their names are self-explanatory. For instance, signal number 9 or SIGKILL notifies the program that it is being attempted to be killed.