Reduce overhead for inheriting from rclcpp::Executor when base functionality is not reused#2506
Merged
Conversation
This is useful in case a second thread needs to wake up another thread, that is sleeping using a clock. Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
This adds support for multiple threads waiting on the same clock, while an shutdown is invoked. Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com>
This commit makes every public funciton virtual, and adds virtual impl function for the existing template functions. The goal of this commit is to be able to fully control the everything from a derived class. Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com>
Co-authored-by: William Woodall <wjwwood@gmail.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com>
Co-authored-by: William Woodall <wjwwood@gmail.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com>
Co-authored-by: William Woodall <wjwwood@gmail.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com>
Co-authored-by: William Woodall <wjwwood@gmail.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
This change allows it to use a second thread to wait for the future to become ready. Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Contributor
|
|
Member
Author
Member
Author
|
Well, CI passed finally, but Windows took way too long, so we're past the deadline. I'm going to ask for an exception for merging this one in tomorrow's meeting. |
alsora
approved these changes
Apr 16, 2024
Member
Author
|
We got approval in the ROS 2 meeting, we'll announce this exception on discourse too. Merging it now. 🎉 |
fujitatomoya
left a comment
Collaborator
There was a problem hiding this comment.
already merged, lgtm as history.
|
This pull request has been mentioned on ROS Discourse. There might be relevant details there: |
bartalor
pushed a commit
to bartalor/rclcpp
that referenced
this pull request
Jul 15, 2026
…onality is not reused (ros2#2506) * feat(clock): Added function to interrupt sleep This is useful in case a second thread needs to wake up another thread, that is sleeping using a clock. Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> * feat: Added support for multi thread wait / shutdown This adds support for multiple threads waiting on the same clock, while an shutdown is invoked. Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com> * chore: Made Executor fully overloadable This commit makes every public funciton virtual, and adds virtual impl function for the existing template functions. The goal of this commit is to be able to fully control the everything from a derived class. Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com> * Update rclcpp/include/rclcpp/executor.hpp Co-authored-by: William Woodall <wjwwood@gmail.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com> * Update rclcpp/include/rclcpp/executor.hpp Co-authored-by: William Woodall <wjwwood@gmail.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com> * Update rclcpp/include/rclcpp/executor.hpp Co-authored-by: William Woodall <wjwwood@gmail.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com> * Update rclcpp/include/rclcpp/executor.hpp Co-authored-by: William Woodall <wjwwood@gmail.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com> * docs: added doc string for spin_until_future_complete_impl Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> * made is_spinning not virtual Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> * feat: Changed interface of spin_until_future_complete_impl This change allows it to use a second thread to wait for the future to become ready. Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> * doc fixup Signed-off-by: William Woodall <william@osrfoundation.org> * undo template->implicit conversion change Signed-off-by: William Woodall <william@osrfoundation.org> * style Signed-off-by: William Woodall <william@osrfoundation.org> --------- Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com> Signed-off-by: jmachowinski <jmachowinski@users.noreply.github.com> Signed-off-by: William Woodall <william@osrfoundation.org> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: jmachowinski <jmachowinski@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor of "API Changes for Multihtreaded Events Executor": #2466