Professional Documents
Culture Documents
Advanced UNIX IPC Facilities
Advanced UNIX IPC Facilities
Advanced UNIX IPC Facilities
UNIX has made the 3 categories of IPC as similar as possible for programming convenience The most (?) important similarity is the IPC key Keys are numbers used to identify an IPC object on a UNIX system Much like a file name being used to identify files Key allows IPC object to be shared by several processes
Message passing
A message is basically a sequence of characters of bytes, not necessarily nullterminated One process creates a message queue using msgget One a queue is established, a process with the right permissions can put messages into it with msgsnd Another process can then read this message with msgrcv
Form of msgget
#include <sys/msg.h> int msgget(key_t key, int permflags);
Permflags
Determines the exact action perform by msgget