ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A

Intraprocess communication with services

I was wondering if anyone can tell me if a ros2.0 service server and client exist in the same process can they share data with shared memory as publishers and subscribers can? The Intra Process tutorial gives a great example of sharing pointers between publishers and subscribers but does not mention if services can support this.


Unfortunately no, we only have support for pub/sub intraprocess. Though I believe it is possible to support Services (the implementation would be slightly different from pub/sub), we just haven’t had the time to implement it yet.

1 Like

Why is it necessary for a intra-process service to share memory ? I thought services are mainly used to call specific functions of a sub/pub in a node.

Well, they don’t need to share memory, but that’s the most efficient thing to do when dealing with intra-process.

Services may or may not be implemented with pub/sub, but that’s up to the middleware implementation. Even if services are implemented with pub/sub, that implementation would occur below where the intra-process optimizations for pub/sub occur.

1 Like