-
Notifications
You must be signed in to change notification settings - Fork 81
Roadmap and guidelines for using Box/Buffer/Queue #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
👀 Could you have a look please, and add your thoughts? And feel free to ping other developers if you think they can provide valuable input to this topic. |
Summary from WG meeting on February 12th:
|
Thanks for the consolidated report @christophfroehlich |
@christophfroehlich Sorry for my late comment. I was awfully occupied the last weeks. RealtimeBox
RealtimeBufferI am not sure if replacing it with a (Lock-Free) queue implementation is the right thing to do. The buffer is (from my understanding) intended to move a value from "non-rt" context to the "rt" context and not for queuing in multiple values for processing into the "rt" context. If the overhead of using a queue implementation is neglectable adding a typedef for the RealtimeBuffer with a maximum queue size of 1 might be a good idea. PS: I just saw the LockFreeQueue is based on boost - a dependency many people try to avoid - so perhaps keeping the Buffer is a good idea RealtimePublisherWhat is missing from my point of view in the list of actions is at least the |
@firesurfer regarding RTPublisher: you are right, but I haven't listed it here because it has a very special purpose and its usage is clear. regarding boost: we already have the dependency of libboost-dev through filters and pal_statistics lib. maybe we can leave a RealtimeBuffer specialication of the queue with size of one as you suggested. but only if it simplifies the usage for users, we'll have to look into that. |
This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups. |
I sincerely apologize for not replying here much earlier, even after constant multiple reminders from @christophfroehlich 🙏🏾
@firesurfer Sure, agreed. If the pointers can only access via the callbacks that use function, i still think it is half safe because the user might still be able to get pointer itself, instead of the data right? realtime_tools/realtime_tools/test/realtime_box_tests.cpp Lines 168 to 182 in 169a2dd
With the above approach, the user can have access to the data outside the ThreadSafeBox, I think this should be better avoided.
I understand your point, however, there is no "buffer" here as the naming suggests. If the idea is to move the values from the real-time context to the non-realtime context then, the RTThreadsafeBox is the right approach in my opinion (ofcourse, without using try_get and try_set), this way there will be priority_inheritance and it is much faster. What do you think?
I don't know if tryPublish is the right approach. Maybe in some applications, publishing is more important than trying alone, so I'm thinking something like an RTPublisher with a buffer size, so the RT thread can keep pushing things and then the non-RT thread can publish them. What do you think about it? |
Uh oh!
There was an error while loading. Please reload this page.
We want to summarize the differences between RealtimeBox and RealtimeBuffer, and compare it with the new Lock-Free Queue proposal.
In the end, we should have guidelines when to use which concept and if maybe any of them is obsolete.
Finally, we will apply the guidelines to ros2_controllers wherever necessary.
General
Within the ros2_control framework, we have only the following use-cases
RealtimeBox
Got refurbed with #139 #146
[Sai]
RealtimeBuffer
[Sai] RealtimeBuffer is what we mostly want, but we have some cons in this:
[Denis] We also need “WriteFromRT”
Lock-Free Queue
Was suggested in #14 and implemented with #253
[Sai]
Example usage: ros-controls/ros2_controllers#1480
The text was updated successfully, but these errors were encountered: