Lably
Skip to content

Signal (IPC)

Form of inter-process communication in computer systems

  • 13 min read
  • 6 chapters

Related on Lably

Through Computer program, Process (computing) and Control flow

A signal is an asynchronous notification sent to a process or to a specific thread within the same process to notify it of an event. Common uses of signals are to interrupt, suspend, terminate or kill a process. Signals originated in 1970s Bell Labs Unix and were later specified in the POSIX standard.

When a signal is sent, the operating system interrupts the target process's normal flow of execution to deliver the signal. Execution can be interrupted during any non-atomic instruction. If the process has previously registered a signal handler, that routine is executed. Otherwise, the default signal handler is executed.

Embedded programs may find signals useful for inter-process communications, as signals are notable for their algorithmic efficiency.

Signals are similar to interrupts, the difference being that interrupts are mediated by the CPU and handled by the kernel while signals are mediated by the kernel (possibly via system calls) and handled by individual processes. The kernel may pass an interrupt as a signal to the process that caused it (typical examples are SIGSEGV, SIGBUS, SIGILL and SIGFPE).

History

  • Version 1 Unix (1971) had separate system calls to catch interrupts, quits, and machine traps.
  • kill (a command to send a signal, by default SIGTERM) appeared in Version 2 (1972).
  • Version 4 (1973) combined all traps into one call, signal.
  • Version 5 (1974) could send arbitrary signals.
  • In Version 7 (1979) each numbered trap received a symbolic name.
  • Plan 9 from Bell Labs (late 80s) replaced signals with notes, which permit sending short, arbitrary strings.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Computing and communication