Q: IPC — how many ways do you know

I get this interview question repeatedly. See the chapters of [[programming perl]] and [[c++ threading]]. Here is my impromptu answer, not backed by any serious research. (Perl and c are similar; java is different.)

Let’s first focus on large volume data flow IPC. As of 2012, fastest and most popular IPC is shared memory, followed by named pipe (or unix domain sockets?). Across machines, you would have to accept the lower throughput of UDP (or worse still TCP) sockets. However, even faster than shared memory is a single-process data flow — eliminating IPC overhead. I feel you can use either heap or the stack. Therefore, the throughput ranking is

# single-process
# shared mem
# named pipe or unix domain sockets
# UDP, TCP

— here’s a fuller list
– signals
– shared mem — extremely popular in MOM and ETL
– named pipes and nameless “|” pipes
– unix-domain sockets;
– command line — for one process to start another process
– env var — for parent process to pass to child process
– shared files, ftp
– DB — wide spread
– RMI — java only
– web service — dominant in cross platform systems
– MOM — dominant async solution in high volume, high-reliability systems
– email;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s