Question about real time safety of snapshot call
Closed this issue · 1 comments
This isn't an issue more of just a question about the snapshot call. I see a lock there so i'm assuming it's not considered a real time safe call? If i'm mistaken could you maybe comment further on it or if you have any future plans to address it? Thanks!
It SHOULD be real time safe.
The mutex used shouldn't be affected by priority inversion.
https://github.com/PickNikRobotics/data_tamer/blob/main/data_tamer_cpp/include/data_tamer/details/mutex.hpp
This should be enough to make it safe in the real-time context.
Also, when used as recomended, i.e. registering all your variable once before calling takeSnapshot
, the mutex will always be unlocked.
On the other hand, I don't think you should call takeSnapshot
from different threads (why would you do that?)
So, I did my best to make this a thread-safe and real-time safe as possible, but if you see any issue, please let me knoe.