It seems like Zero-Copy does not lock when loaned by a subscriber? #2849
Replies: 2 comments 1 reply
-
Hi @willstott101, As mentioned in Fast DDS Zero-Copy documentation, Data-sharing delivery constraints also apply. You can find more information about the DataWriter/DataReader History coupling there. Samples are acknowledged and mark as ready to be reused when I hope this information helps with your use case! |
Beta Was this translation helpful? Give feedback.
-
Never-mind I just read through this very informative thread: #2369 I guess zero-copy isn't memory-safe in Fast-DDS without a bunch of application guarantees I can't provide (hard-coded buffer sizes bound to application performance). |
Beta Was this translation helpful? Give feedback.
-
I have two programs here:
Which I wrote intended to prove that zero-copy does in-fact work in FastDDS. What I found surprisingly is that whilst it does seem to work, it also seems like
reader->read
does not lock the underlying sample - allowing the DataWriter to mutate the sample which a subscriber is currently inspecting.Surely this is not the desired behavior? Is it a known limitation that I have failed to notice in the docs?
My test involves:
Here is the output I am seeing when running those two programs together (note the unchanging timestamp, but changing value):
Beta Was this translation helpful? Give feedback.
All reactions