Skip to content
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

More overall improvements to the code #98

Merged
merged 4 commits into from
Jan 25, 2024
Merged

Conversation

clalancette
Copy link
Collaborator

This small series does another pass through the subscription, clients, services, and guard condition code, making improvements. In particular:

  1. It fixes a bug where guard conditions would be ready over and over again. This would cause very high CPU load. Now once we get the status of a guard condition, we also reset the trigger.
  2. It encapsulates subscriptions, services, and client code into their own classes. This allows us to make more of the class fields private, and do proper locking around them. It also has a side benefit of moving some code out of rmw_zenoh.cpp, which has grown quite large.

This moves more of the implementation out of rmw_zenoh.cpp
and into the class handling the subscription data.

Signed-off-by: Chris Lalancette <[email protected]>
This just allows us to hide more of the implementation and
remove it from rmw_zenoh.cpp.  It also fixes some of the
locking, which wasn't correct previously.

Signed-off-by: Chris Lalancette <[email protected]>
This allows us to encapsulate more of the client data in
the right place, and also allows us to fix the locking.

Signed-off-by: Chris Lalancette <[email protected]>
That is, once we have discovered what the guard condition
status is, we should immediately reset the trigger condition
and wait for the next one.  Otherwise we risk triggering
over and over again.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette clalancette requested a review from Yadunund January 23, 2024 14:50
Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for cleaning up the implementation.

@Yadunund Yadunund merged commit 76fec8b into rolling Jan 25, 2024
5 checks passed
@delete-merged-branch delete-merged-branch bot deleted the clalancette/encapsulate branch January 25, 2024 07:06
@Yadunund Yadunund mentioned this pull request Feb 8, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants