-
Notifications
You must be signed in to change notification settings - Fork 304
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
[RM] Decouple read/write cycles of each component with mutex to not block other components #1646
Changes from all commits
f540edb
02d08eb
50fa996
e10b2f6
7fbf13e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1770,7 +1770,6 @@ void ResourceManager::shutdown_async_components() | |
HardwareReadWriteStatus ResourceManager::read( | ||
const rclcpp::Time & time, const rclcpp::Duration & period) | ||
{ | ||
std::lock_guard<std::recursive_mutex> guard(resources_lock_); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why don't we need this here? or why do we need this lock in other methods of this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mutex from here is from the Resource Manager, it is used along with non-RT threads, as it is used this way, there is most likely a chance that it can block the read and write cycles. We have added in other methods because, when this happens, the read cycles of that particular interface can be skipped instead of waiting for the cycle as it is configuring itself to be activated or deactivated |
||
read_write_status.ok = true; | ||
read_write_status.failed_hardware_names.clear(); | ||
|
||
|
@@ -1831,7 +1830,6 @@ HardwareReadWriteStatus ResourceManager::read( | |
HardwareReadWriteStatus ResourceManager::write( | ||
const rclcpp::Time & time, const rclcpp::Duration & period) | ||
{ | ||
std::lock_guard<std::recursive_mutex> guard(resources_lock_); | ||
read_write_status.ok = true; | ||
read_write_status.failed_hardware_names.clear(); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we need this in the other interface.hpp files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added them in other interfaces.hpp as well