Closed saikishor closed 3 days ago
Attention: Patch coverage is 76.47059%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 72.72%. Comparing base (
069df6d
) to head (9ac21d4
).
Files with missing lines | Patch % | Lines |
---|---|---|
src/realtime_helpers.cpp | 76.47% | 0 Missing and 4 partials :warning: |
I just saw the PR by chance and was interested as I authored the original one. I am wondering in which (realtime) scenario would you like to prefer a set of cores? From my understanding every time a thread is executed on the different core we suffer from
a) Context switch overhead b) Additional cache misses
Both brings in an uncertainty which we do not want in RT scenarios.
The only case I can imagine this could help is modern CPUs with multiple dies inside (e.g. most Ryzen processors). But the OS scheduler will already take care of trying not to move threads between cores on different dies per default.
@firesurfer You can set it at the startup as we do in the ros2_control_node or in the configure of controllers and hardware components
@firesurfer You can set it at the startup as we do in the ros2_control_node or in the configure of controllers and hardware components
I am aware of that. But I just wanted to understand why it is an advantage in a RT scenario to use the group of cores instead of tying the thread to a single core.
I am aware of that. But I just wanted to understand why it is an advantage in a RT scenario to use the group of cores instead of tying the thread to a single core.
By default, it uses mostly Core 0 as other. If you can use a set of performance cores, it would be better for the RT application, if your application needs more computational power than one core, then this definitely helps
This PR adds a new method that helps to set multiple CPUs for affinity instead of only one and this will help in choosing couple of CPUs to run the controller_manager etc