From bcad3b91c59522eeafdf3d3c9ea8f04da59b9187 Mon Sep 17 00:00:00 2001 From: atsushi421 Date: Sun, 25 Jan 2026 19:13:18 +0900 Subject: [PATCH 1/2] Add notes on adoption section to README Document potential concurrency issues when migrating from SingleThreadedExecutor and considerations for real-time scheduling policies (SCHED_FIFO, SCHED_DEADLINE). --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index edfef32..d36833c 100644 --- a/README.md +++ b/README.md @@ -271,3 +271,9 @@ You need to apply the `SCHED_DEADLINE` policy only after the system has fully st While the target ROS 2 application is running, the configurator node's window should not be closed and must remain open. After the execution of the target ROS 2 application has ended, press the enter key in the window displaying `Press enter to exit and remove cgroups...`. This will terminate the execution of the configurator node and simultaneously delete the cgroup that was created for setting the affinity of tasks with the `SCHED_DEADLINE` policy. + +## Notes on Adoption + +When replacing `rclcpp::executors::SingleThreadedExecutor` with `CallbackIsolatedExecutor`, a dedicated thread is created for each CallbackGroup, enabling parallel execution. This may expose concurrency bugs that were previously hidden. Therefore, before adoption, you should carefully investigate whether there are any locations that require mutexes or synchronization. + +When using real-time scheduling policies, such as `SCHED_FIFO` or `SCHED_DEADLINE`, you must carefully consider the potential for delaying kernel processing and other applications, and configure affinity, priority, and [throttling](https://man7.org/linux/man-pages/man7/sched.7.html) appropriately. From 89c23343fe8823980bbb44b02e032a995b05deb6 Mon Sep 17 00:00:00 2001 From: atsushi421 Date: Sun, 25 Jan 2026 19:16:26 +0900 Subject: [PATCH 2/2] fix --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d36833c..8d3a842 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,8 @@ This will terminate the execution of the configurator node and simultaneously de ## Notes on Adoption -When replacing `rclcpp::executors::SingleThreadedExecutor` with `CallbackIsolatedExecutor`, a dedicated thread is created for each CallbackGroup, enabling parallel execution. This may expose concurrency bugs that were previously hidden. Therefore, before adoption, you should carefully investigate whether there are any locations that require mutexes or synchronization. +When replacing `rclcpp::executors::SingleThreadedExecutor` with `CallbackIsolatedExecutor`, a dedicated thread is created for each CallbackGroup, enabling parallel execution. +This may expose concurrency bugs that were previously hidden. Therefore, before adoption, you should carefully investigate whether there are any locations that require mutexes or synchronization. +Note that callbacks within the same `MutuallyExclusiveCallbackGroup` are still executed serially. When using real-time scheduling policies, such as `SCHED_FIFO` or `SCHED_DEADLINE`, you must carefully consider the potential for delaying kernel processing and other applications, and configure affinity, priority, and [throttling](https://man7.org/linux/man-pages/man7/sched.7.html) appropriately.