Signals

We've already mentioned signals in UNIX. They are rather like interrupts, except in software. When a process receives a signal, a special 'signal handler' routine is called. A process may also put itself to sleep, waiting for a signal.

In the general case, there is the problem of 'lost' signals; signals which a process receives before it started waiting.

A possible solution to this, used in the Amiga operating system, is to set a flag in the process whenever it receives a signal. If it tries to wait for a signal, and the bit for that signal is already set, the 'wait' operation does not block.

It is possible to regard  a semaphore as a generalised signal:


last updated 13 February 1998