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

[documentation] Explain when MultiThreadedExecutor is running multiple threads #2454

Open
wants to merge 5 commits into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rclcpp/include/rclcpp/executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ class Executor

/// Spin (blocking) until the future is complete, it times out waiting, or rclcpp is interrupted.
/**
* The implementation is suitable for a single-thread model of execution.
* \param[in] future The future to wait on. If this function returns SUCCESS, the future can be
* accessed without blocking (though it may still throw an exception).
* \param[in] timeout Optional timeout parameter, which gets passed to Executor::spin_node_once.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ class MultiThreadedExecutor : public rclcpp::Executor
RCLCPP_PUBLIC
virtual ~MultiThreadedExecutor();

/// Multi-threaded implementation of spin.
Copy link
Contributor

Choose a reason for hiding this comment

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

Multi-thread 😸

/**
* \sa rclcpp::Executor:spin() for more details
* This function will block until work comes in, and try to execute all work with
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not correct.
This function won't block until works come in, but rather it will block until interrupted.

* configured multiple threads, and then repeat the process until canceled.
* It may be interrupted by a call to rclcpp::Executor::cancel() or by ctrl-c
* if the associated context is configured to shutdown on SIGINT.
* \throws std::runtime_error when spin() called while already spinning
*/
RCLCPP_PUBLIC
Expand Down