An interrupt is an event that requires the attention of the operating system kernel. When an interrupt occurs, the kernel may suspend the current process, and execute a special interrupt handler to deal with the event.
A signal is a software interrupt that is sent to a process by the kernel, or by another process. A signal may be generated by the user, such as with the kill command, or by the operating system in response to an event, such as a segmentation fault.
Interrupts and signals are similar, but have some important differences.
An interrupt is generated by hardware, and causes the kernel to suspend the current process and execute a special interrupt handler.
Interrupts can be generated by the user, such as with the kill command, or by the operating system in response to an event, such as a segmentation fault.
A signal is a software interrupt that is sent to a process. A signal may be generated by the user, such as with the kill command, or by the operating system in response to an event, such as a segmentation fault.
Signals are generated by the kernel, or by another process. When a signal is generated, the kernel may suspend the current process, and execute a special signal handler to deal with the event.
Interrupts and signals are similar, but have some important differences: