Data Communication

IPC Mechanisms

Given two processes, what are the actual mechanisms that we can implement to get them to talk to each other?

Resources

Same Machine

Same OR Different Machine

  • Network Socket: Has machines communicate over sockets through TCP/UDP

If Shared memory is the fastest, why is that not the default?

The primary challenge with shared memory is that it requires explicit synchronization between processes to avoid race conditions (e.g., using mutex or semaphores).

Pipes and UDS both involve a Producer-Consumer Problem where the OS guarantees that data is read and written in a well-defined order.

What about ROS2?

For ROS 2, the underlying IPC mechanism is DDS, which uses sockets (UDP/TCP) for inter-process communication over the network, and may use shared memory for intra-process communication within the same machine.