Interprocess communication
Files: reading or writing files shared with other processes
Pipes: a bidirectional channel between a parent and child
process. The pipe(2) system call returns a pair of file
descriptors representing the pipe endpoints, which can then be
connected between a parent and child process or two children.
Signals: a set of standard event notifications, some usually delivered
from the OS to a process, but also delivered from one process to
another using the kill(2) system call.
- Example signals:
- SIGHUP: terminal disconnect
- SIGINT: CTRL-C on terminal
- SIGFPE: arithmetic (floating-point) exception
- SIGSEGV: segmentation violation, meaning access to an invalid or
protected region of memory
- SIGTERM: terminate process
- SIGSTOP: suspend process execution
- SIGCONT: resume execution
- . . . and many more.
- Most signals have a default action of causing a process to exit
(unless intended to cause some other action like SIGSTOP/SIGCONT),
and may also cause the OS to write a "core image" containing virtual memory
contents.
- Processes can chose to catch some signals by using
signal(2) to install their own handler and run a routine of their
choice when the signal occurs, or ignore the signal (but not all signal types are
catchable/ignorable, like SIGKILL)
Shared memory: a memory region shared by multiple processes.
Network sockets or UNIX-domain sockets: a way for processes to
rendezvous over the network (even across machines) or through a
conventional pathname (on the same machine).
Next ->
Steve VanDevender
Last modified: Thu Jul 5 14:29:59 PDT 2007