SHM transport is supported in Micro XRCE-DDS, the micro-ROS middleware implementation.
The XRCE-DDS client Shared Memory Transport (SHM) provides a way of communicating micro-ROS nodes that exist in the same MCU without the need of interacting with the micro-ROS Agent.
Some of the shared memory transport advantages are:
SHM allows large message support
Network protocols need to fragment data in order to comply with the specific protocol and network stacks requirements, increasing communication overhead. SHM transport allows the copy of full messages where the only size limit is the machine’s memory capacity.
SHM reduces the number of memory copies
When sending the same message to different entities, SHM transport can directly share the same memory buffer with all the destinations. Other protocols require to perform one copy of the message per endpoint.
SHM requires less operating system overhead
Once initial setup is completed, shared memory transfers require much less system calls than the other protocols. Therefore, there is a performance/time consumption gain by using SHM.
The shared memory functionality is the result of a shared effort between the Client and the Agent. This approach provides the Clients with self-introspection capabilities to autonomously detect compatible publishers, subscribers or any other DDS entity, without the need to recur to the Agent. The Agent, which by default acknowledges the existence of matching entities in the same Client, blocks resending the duplicated matching information to the Client.
As a result, SHM enables fast communications between entities running in the same MCU.
This functionality, which has been repeatedly asked for by the community, is still heavily prototypical. Therefore, in order to debug and improve it, we kindly invite users to volunteer using it and provide feedback!