In what ways can processes communicate?
UNIX processes on their own are boring; they are interesting when they communicate. There are many methods of “Inter-process communication”, or IPC. What are all these methods? There are many!:
write. The sender writes to a file; the receiver reads from it. USP: durability.
write. A pipe, created with
pipe, is a byte queue.
pipereturns file descriptors for both ends. Closing both ends destroys the pipe.
kill. The sender can send a signal to the receiver. A signal does not have associated data.
write. Sockets link processes over network interfaces. USP: connecting remote processes (not just local ones).
- Message queues:
mq_timedsend. A message queue is a bit like a pipe, but with a proper concept of messages (a message is a byte array).
semop. Used to protect common resources used by processes.
- Shared memory:
shmgetand friends. A single memory location can be read/written by multiple processes. USP: communication via memory, not system calls.
More by Jim
- Project C-43: the lost origins of asymmetric crypto
- How Hacker News stays interesting
- My parents are Flat-Earthers
- The dots do matter: how to scam a Gmail user
- The sorry state of OpenSSL usability
- I hate telephones
- The Three Ts of Time, Thought and Typing: measuring cost on the web
- Granddad died today
- Your syntax highlighter is wrong
I wrote this because I felt like it. This post is not associated with my employer. Found an error? Edit this page.