sykwer / component_container_callback_isolated

A component container that assigns a dedicated thread for each callback group.
Apache License 2.0
0 stars 0 forks source link

[QST] The difference between single-mt-multi-cbg and multi-sste-multi-cbg using node-level-cbg? #1

Open ZhenshengLee opened 1 year ago

ZhenshengLee commented 1 year ago

Hi, First I want to say this is a great work!

I our practices, we use the typical way of using node-level-cbg with a multi-threaded-executor adding many cbg(sub: cbg is 1:1), and there are many threads inside the executor.

But in your repo I see a noval design with many single-threaded-executor adding only one cbg(executor: sub: cbg is 1: 1: 1), and there are many executors which only spawn one thread.

I think both ways are multi-thread-subscription. What't the big difference between them, and your considerations about this design? Are you finding some issues about the typical usage of what I said above?

more info about node-level-cbg is here https://github.com/clalancette/executor_examples/tree/master/src more info about executor-level-cbg https://github.com/ros2/examples/tree/rolling/rclcpp/executors/cbg_executor

Thanks.

ZhenshengLee commented 1 year ago

What I am thinking.

https://github.com/ros2/examples/blob/1d97c4fc7445554f6f85f63305d424fc017212a0/rclcpp/executors/cbg_executor/src/ping.cpp#L51-L80

But the threads management is covered by your ComponentManagerCallbackIsolated::add_node_to_executor

https://github.com/sykwer/component_container_callback_isolated/blob/3d84f28e7c97239a65ff3706908b1dd3e8c8e215/src/component_container_callback_isolated.cpp#L64-L67

What's your idea about thread readtime configurations?