首先需要知道signals和interrupt是不同的。
signal属于进程通信机制的一种实现方式
(还有的实现为:Pipes、Sockets
其中Sockets又可分为: System V IPC Mechanisms、Message Queues、Semaphores、Shared Memory)
关于进程间通信,具体参见:Chapter 5
Interprocess Communication Mechanisms
而具体的不同,别人的回答是:
Interrupts can be viewed as a mean of communication between the CPU and the OS kernel. Signals can be viewed as a mean of communication between the OS kernel and OS processes.
Interrupts may be initiated by the CPU (exceptions -e.g.: divide by zero, page fault), devices (hardware interrupts -e.g.: input available), or by a CPU instruction. They are eventually managed by the CPU, which “interrupts” the current task,and invokes an 0S-kernel provided ISR/interrupt handler
Signals may be initiated by the OS kernel(下面的实例也揭示了这一点), or by a process( kill() ). They are eventually managed by the OS kernel, which delivers them