|CS 321 Spring 2012 > Lecture Notes for Friday, February 17, 2012|
Recall synchronous, or blocking, operations vs. asynchronous, or non-blocking.
Simple message-passing mechanism. A traditional part of C library under *ix OSs. Very little information is sent—only the signal itself. By default, asynchronous, handler function executed using standard process stack.
A handler function takes an
int (the signal)
Set up a handler by calling system call
passing the signal name and a pointer to the handler function.
Signals are sent by
kill system call.
Also a program named
kill can be used on the command line.
Here are some of the more common signals. There are many others, most of which are rarely used. The default response is what happens to the process receiving the signal if it has not set up a handler function.
|Signal||Sent By||Can Be Handled||Default Response|
The alarm signal (
SIGALRM) is particularly interesting,
since it is most often used by a process to signal itself.
The signal is sent after some fixed amount of time has elapsed.
Message-Passing IPC will be continued next time.