-
Notifications
You must be signed in to change notification settings - Fork 914
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
High CPU-load in Debug mode #1715
Comments
One solution would be to extend #1651 and use the internal version of Or, if possible, copy the Boost 1.67+ implementation of Both alternatives would break the ABI if I am not mistaken, unless the internal memory layout of |
This issue should have been fixed by #1878 and #1932 (for For Noetic the custom internal implementation of |
Can be closed? |
If ros_comm has been build in Debug-mode (which is catkins default), and one starts roscore, two rosout-process are launch, which taking up about 80% to 160% cpu load. The reason for this is a busy loop in the spinner. The
wait_for
calls inCallbackQueue::callAvailable
are not working properly. The reason for that seems to be, that incallback_queue.cpp
BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC
is define, and anywhere else it is not. Therefore there are multiple definitions ofboost::condition_variable::wait_for
in different translation units, which are not identical. This violation of the one-definition-rule results in the behavior described above.If one adds
add_definitions(-DBOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC)
to the CMakeLists.txt of roscpp and rosout, this problem does not occur.This problem does not occur in the release, because in Release-mode `ẁait_for`` is inlined and therefore the ODR-violation is not a problem. But If one wants use ros_comm from source this is a problem.
This issue has will occur in every no
BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC
de, whereboost::condition_variable
is used.In #1608 this problem has been described before. #1651 is a step in the right direction, but is not sufficient, because
BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC
needs to be defined in every translation unit, which usesboost::condition_variable
and is linked (statically or dynamically) to roscpp.The text was updated successfully, but these errors were encountered: