Interprocess Communication – Mac, Windows, Linux

This is a work in progress.

IPC on Mac

Here are the options

  • Sockets
  • Mach ports
  • Pipes
  • FIFOs
  • Shared memory

There is also XPC, but this requires you to refactor your code into XPC services, so this isn’t really IPC as generally talked about.

<more here>

IPC on Windows

Here are the options

  • Data Copy (WM_COPYDATA)
  • File mapping
  • Named shared memory
  • Pipes
  • RPC
  • Windows Sockets

This ignores several older techniques such as Clipboard, COM, or DDE. Mailslots are technically IPC, but generally used for broadcast and best-effort instead of point-to-point guaranteed communication.

Data Copy

This only works between processes on the same machine.

File Mapping

This only works between processes on the same machine.

Uses CreateFileMapping and MapViewOfFile to map a file to memory, then read and write to memory to perform the IPC operations. This can be fairly efficient, although the processes will need to coordinate reads and writes. The downside is that this will result in file writes, reducing efficiency. Generally, you would avoid doing this in favor of the named shared memory variant.

Named Shared Memory

This only works between processes on the same machine.

This is a special variant of File Mapping that creates file mapping objects referencing the system paging file. The advantage here is that no actual file is needed. This is the closest equivalent on Windows to shared memory as found on Linux or Mac.


Anonymous pipes can only be between processes running on the same machine, and typically between a parent process and a child process. However, it is possible to send the pipe handles to another process by a separate IPC mechanism (such as shared memory).

Named pipes can be used between arbitrary processes on the same or different machines.

IPC on Linux