-
I'm trying to maintanance several pieceses of shared memory between publisher and subscribers.
So re-publish and edit to this chunk safely is no more possbile. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@wxtry The answer is currently that we do not support keeping the sample after publishing. Normally, one would implement such a thing with a mutex but just imagine what happens when a subscriber dies while holding the mutex. Then the subscriber can deadlock the publisher as well which violates our freedom of interference principle which is required in a safety critical environment. So the solution will be a little bit more complex. But you are lucky, we already have an issue (#927) for this since you are not the only one with that use case. |
Beta Was this translation helpful? Give feedback.
@wxtry The answer is currently that we do not support keeping the sample after publishing.
The problems can result in a data race when some subscriber would like to read the sample while you are modifying it on the publisher side. Here we would require a mechanism to either provide exclusive read or write access to either the publisher or the subscriber.
Normally, one would implement such a thing with a mutex but just imagine what happens when a subscriber dies while holding the mutex. Then the subscriber can deadlock the publisher as well which violates our freedom of interference principle which is required in a safety critical environment. So the solution will be a little bit more comp…