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

feat: Thread configuration prototype #1075

Open
wants to merge 7 commits into
base: rolling
Choose a base branch
from

Conversation

smorita-esol
Copy link

@smorita-esol smorita-esol commented Jun 6, 2023

This is a prototype implementation of RCL for discussion about the thread configuration feature to receive and apply a set of scheduling parameters for the threads controlled by the ROS 2 executor.

Our basic idea is as below.

  1. Implement a new class rclcpp::thread and modify rclcpp to use it. This class has the same function set as the std::thread but also additional features to control its thread attributions.
  2. Modify the rcl layer to receive a set of scheduling parameters. The parameters are described in YAML format and passed via command line parameters, environment variables, or files.
  3. the rclcpp reads the parameters from rcl and applies them to each thread in the thread pool.

There have been some discussions about this pull request, as below.

[ROS Discourse]
https://discourse.ros.org/t/adding-thread-attributes-configuration-in-ros-2-framework/30701

[ROS 2 Real-Time Working Group]
ros-realtime/ros-realtime.github.io#18

This is a prototype implementation of RCL for discussion about the thread configuration feature to receive and apply a set of scheduling parameters for the threads controlled by the ROS 2 executor.

Our basic idea is as below.
 1. Implement a new class rclcpp::thread and modify rclcpp to use it.
   This class has the same function set as the std::thread but also additional features to control its thread attributions.
 2. Modify the rcl layer to receive a set of scheduling parameters.
   The parameters are described in YAML format and passed via command line parameters, environment variables, or files.
 3. the rclcpp reads the parameters from rcl and applies them to each thread in the thread pool.

There have been some discussions about this pull request, as below.
[ROS Discourse]
https://discourse.ros.org/t/adding-thread-attributes-configuration-in-ros-2-framework/30701
[ROS 2 Real-Time Working Group]
ros-realtime/ros-realtime.github.io#18

Signed-off-by: Shoji Morita <s-morita@esol.co.jp>
@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/adding-thread-attributes-configuration-in-ros-2-framework/30701/2

@wjwwood
Copy link
Member

wjwwood commented Jun 15, 2023

See my comment here: ros2/rclcpp#2205 (comment)

This seems useful, but we should probably adjust where the code lives and how we extend rcl/rclcpp to accommodate them.

@wjwwood wjwwood removed their assignment Jun 15, 2023
…he pointing out below.

ros2/rclcpp#2205 (comment)

Signed-off-by: Shoji Morita <s-morita@esol.co.jp>
Signed-off-by: Shoji Morita <s-morita@esol.co.jp>
@smorita-esol
Copy link
Author

I've shared the draft version of the REP related to this pull request, as provided below.
I would greatly appreciate it if you could kindly share your feedback or point out any areas that need improvement.
https://discourse.ros.org/t/adding-thread-attributes-configuration-in-ros-2-framework/30701/5?u=smorita-esol

The modification of the interface is to go along with the
specification described in the draft REP shared in the thread below.

https://discourse.ros.org/t/adding-thread-attributes-configuration-in-ros-2-framework/30701/5

Signed-off-by: Shoji Morita <s-morita@esol.co.jp>
…e update of REP-2017 below.

ros-infrastructure/rep#385

Signed-off-by: Shoji Morita <s-morita@esol.co.jp>
Signed-off-by: Shoji Morita <s-morita@esol.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants