If the requirement of running the processes in (a) same machine, as well as (b) different machine is important, then I would choose TCP/IP Internet socket
s (AF_INET). It works in both situations and complexity is completely hidden from the application.
(Note that, if performance is the dominating metric, then I would choose differently for case #a.)