Skip to content

Add OS scheduling parameters control #18

@smorita-esol

Description

@smorita-esol

Referring to the draft paper of the executor design below, I found that we face the same challenge below (particularly b.).
https://docs.google.com/document/d/1O53xOVlk4zwsfNukLaDbSWfT64wnoD9xh2EjWwX43qo/edit

 1. What kind of cooperation do we want with the OS?
 a. E.g. CPU pinning, memory locking, using the OS scheduling policies
 b. How could OS scheduling parameters be assigned to ROS 2 Executor and
 enforced by the OS (see note in rclc-executor)?

My team is currently investigating how to pass the scheduling parameters to the ROS 2 Executor. And we have already implemented a prototype to receive and apply a set of scheduling parameters for the threads controlled by the ROS 2 real-time executor. We'd like to share the code with the community as some pull requests, but it might be better to share it here and get some feedback from the members who face the same problem here beforehand.

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. *1
    *1. the current implementation uses them only for the Multithread Executor.

I've forked the rcl and rclcpp repositories to our team's account and created pull requests for them so that we will be able to have a discussion about it.
rcl: esol-community/rcl#1
rclcpp: esol-community/rclcpp#1

And, considering the discussion below, my team will add a rclcpp::thread implementation delegating all the functions to the std::thread ASAP so as to be able to be used in the environment where the specific rclcpp::thread is not implemented yet.
ros2/rcutils#406

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions