Choosing a Linux IPC?

I have two processes A and B. A and B need to communicate (bi-directionally) sometimes to transmit signals, messages, etc.
I did some basic IPC research available on Linux, such as semaphore, message queuing, dbus, etc.
Now I'm confused about deciding which one to use, can someone tell me which IPC is better to use for my application?

Thank you in advance

Edited: Application Development. (This is a built-in application)
Process A will monitor the temperature, speed calculation, etc. Process B will drive the engine by reading sensor values ​​(numerical), etc. Sometimes I need to send a signal to process B, indicating that the maximum temperature has been reached, so stop the engine. Sometimes it is necessary to send data read from the sensor in process A to process B. Similarly, numerical data must be transmitted through the process. And I do it in ARM Architecture.

+6
source share
1 answer

The choice of IPC method depends on the application you are trying to implement. The following is a good performance comparison base:

IPC name Latency Throughput Description ----------------------------------------------------------------------------------------- Signal Low n/a Can be used only for notification, traditionally- to push process to change its state Socket Moderate Moderate Only one mechanism which works for remote nodes, not very fast but universal D-Bus High High A high-level protocol that increases latency and reduces throughput compared to when using base sockets, gains in increased ease of use Shared n/a High Data saved in-between process runs(due to swapping memory access time) can have non-constant access latency Mapped files n/a High Data can be saved in-between device boots Message Low Moderate Data saved in-between process runs. The message queue size is limited but there is less overhead to handle messages 

Here is another nice comparison

Comparing IPC on Unix / Linux

+12
source

All Articles