I have learnt below IPC mechanisms,
BSD style half-duplex pipes
SYSV style message queues
SYSV style semaphore sets
SYSV style shared memory segments
BSD style sockets
Half-duplex pipe can be used as 1-1 process communication, one-way. Any connected process must share a related ancestory. pipe()
allow communication between processes, within a system.
Message queue(linked list) can be used as 1-1 process communication, bi-directional between any two processes(long mtype
) within a system. For every msgsnd()
from one process creates an item in queue(linked list), corresponding msgrcv()
from another process read/delete the queue item.
Shared memory can be used as a many-many process communication, bi-directional, within a system. Internally, it is a mapping of an area (segment) of memory that will be mapped and shared by more than one process.
BSD socket(socket()
/bind()
/listen()
/accept()
) can be used for many(client)-one(server) two-way communication across systems with different OS, but in a client-server mode.
Question:
1)
Across systems with similar OS, what is the IPC mechanism(provided by Linux) for many-many process communication, in non client-server mode?
2)
Across systems with different OS, what is the IPC mechanism(provided by Linux) for many-many process communication, in non client-server mode?
connect()
request on TCP/IP stack andread()
/write()
2) talks directly to server(struct sockaddr_in
) on UDP/IP stack andsendto()/recvfrom()
. Server, I mean, a process, whichlisten()
/accept()
to requests from client