1. Introduction to the signal
There is no time in the Linux system to generate a signal. The signal is also called software interruption on Linux,used to notify the process that an asynchronous event has occurred. At the software level is a simulation of the interrupt mechanism, in principle, a process receives a signal and the processor receives an interrupt request can be said to be the same. signal is the only asynchronous communication mechanism in inter-process communication mechanism,a process does not have to wait for the signal to arrive by any action, in fact, the process does not know when the signal will arrive. Processes can send soft interrupt signals to each other via system call Kill. The kernel can also send a signal to the process because of an internal event, notifying the process that an event has occurred. In addition to the basic notification function, the signal mechanismyou can also pass additional information.
2. Four elements of the signal
-
Number: Each type of signal has a unique number in the Linux system. All signals can be viewed via kill-l under the command
Signal name: Each signal has a unique signal name in the Linux system, which can be used to view all signals via kill-l at the command.
Event: A specific event needs to be met before sending
Default processing action: Each signal has a default processing behavior (detailed below)
3. Sharing of Signals:
-
Simple: The signal is the least expensive mechanism in the Linux IPC interprocess communication
Cannot carry large amounts of data
Need to meet specific events before sending
4. Mechanism of the signal
5. Classification of generated signals
6. How the signal is processed
This article is from the "Sea" blog, be sure to keep this source http://lisea.blog.51cto.com/5491873/1787830
Linux network programming---------Signal Big Lecture Hall