Data-sharing delivery is more efficient than Shared Memory Transport? #3654
-
Right? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 15 replies
-
Although Data-sharing delivery uses shared memory, it differs from Shared Memory Transport in that Shared Memory is a full-compliant transport. That means that with Shared Memory Transport the data being transmitted must be copied from the DataWriter history to the transport and from the transport to the DataReader. With Data-sharing these copies can be avoided. Use of Data-sharing delivery does not prevent data copies between the application and the DataReader and DataWriter. These can be avoided in some cases using Zero-Copy communication. Answering your question, Shared memory transport should be used when the application does not meet the Data-sharing constraints. |
Beta Was this translation helpful? Give feedback.
-
Hi @JesusPoderoso . If we use RTPS directly to send/receive data, should we drop the serialization/deserialization counts (since these are handled in the user application)? |
Beta Was this translation helpful? Give feedback.
You are describing the something different from Shared Memory (SHM).
Here it is necessary to differentiate between the different copies that occur in the different communication layers involved.
On one side, the application data is serialized (and deserialized) to the DataWriter history (and from DataReader history, respectively). That serialization involves a copy (as well as deserialization involves another copy). It can be avoided using the loan mechanism (example described in Zero-Copy communication section).
Network based transports data copies
Then, if a network transport is involved (UDP or TCP), the serialized data requires an encapsulation, adding a header and other valuable info…