Does eCAL support inner-process communication already? #965
-
I am working with eCAL 5.11.2 in C++, using Cmake. Currently I can't get subscriber and publisher of the same topic to work simultaneously, as the first try. I then tired to change I then found this example It points me to an API Now it works. May I know what is happening here?
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
tl;dr: If you want your process to receive data from publishers from the same process, just keep the transport layers in their default configuration, but call
With So why does it behave like that? Because receiving the data that you sent yourself is undesired for some people. Is there any downside when enabling Loopback? No. If you want to receive the data you sent in your own process, just enable it and be happy.
The inproc transport layer is a transport layer that can only transport data inside its own process. Is there a reason to use it without enabling loopback? No, that doesn't make sense. eCAL will not warn you about that configuration, but you are then telling it to "Only send data to your own process, but ignore everything that comes from your own process!". Are there advantages of inproc compared to SHM? Not sure, maybe @rex-schilasky can comment on that 😀 |
Beta Was this translation helpful? Give feedback.
-
The logic of inproc transport layer is that a publisher send call will executed all subscriber data callback in the same (publisher send call) thread. This is for sure quite fast (no copy needed here) but it couples the execution of the publisher send thread to the processing of the subscriber callback function. So very often the overall performance will decrease because you force a single threaded execution here. If you switch on Loopback (as described by Florian) an inner process publisher is connected to inner process subscribers via memory file and they can act decoupled in a parallel manner. A second aspect is .. if you have let's say one subscriber in the same node and at least one external subscriber (can be another node, the eCAL recorder or an eCAL monitor live data view) then anyway a memory file needs to be opened and maintained and you will not get any performance adds by using the inproc layer in parallel. Hope that helps :-) |
Beta Was this translation helpful? Give feedback.
The logic of inproc transport layer is that a publisher send call will executed all subscriber data callback in the same (publisher send call) thread. This is for sure quite fast (no copy needed here) but it couples the execution of the publisher send thread to the processing of the subscriber callback function. So very often the overall performance will decrease because you force a single threaded execution here.
If you switch on Loopback (as described by Florian) an inner process publisher is connected to inner process subscribers via memory file and they can act decoupled in a parallel manner.
A second aspect is .. if you have let's say one subscriber in the same node and at least one …