next up previous
Next: Message Passing Up: Interprocess Communication Previous: Shared Memory

Software Interrupt

We can introduce a service call that lets one process cause a software interrupt in another:

Interrupt(process id, interrupt number)
and another that allows a process to associate a handler with an interrupt:
Handle(interrupt number, handler)

Software interrupts are often used by an operating system to inform a process about the following events:
The user typed the ``attention key''.
An alarm scheduled by the process has expired.
Some limit, such as file size or virtual time, has been exceeded.

It is important to distinguish among interrupts, traps, software interrupts, and exceptions. In all cases, an event is processed asyncrhonously by some handler procedure. Interrupt and trap numbers are defined by the hardware which is also responsible for calling the procedure. Software trap numbers are defined by the operating system which is responsible for calling the procedure. An interrupt handler is called in response to a signal from another device while a trap handler is called in response to an instruction executed within the cpu. A software interrupt handler is called in response to the invocation of a system call. Exceptions are processed by the programming language. An exception raised in some block, b, of some process p, can be caught by a handler in the same block, or a block/procedure (in p) along static/dynamic links from b, or by a process q that (directly or indirectly) forked p. The rasiser of an exception does not identify which process should handle it, so exceptions are not IPC mechanisms.


Prasun Dewan
Thu Sep 18 10:55:57 EDT 1997