Summary
spawn_non_ros2_thread in agnocast_cie_thread_configurator currently uses an rclcpp publisher/subscriber pair to send a single (thread_id, thread_name) payload from each non-ROS worker thread to thread_configurator_node. Because every call constructs a fresh rclcpp::Context, Node, and Publisher, each non-ROS thread pays the full cost of standing up a brand-new DDS Participant just to deliver a few bytes.
Problem
Each invocation of spawn_non_ros2_thread:
- Spawns a fresh DDS Participant (one per non-ROS thread).
- Waits up to 5 s for DDS discovery before the first publish can succeed.
- Then waits up to 500 ms more on
wait_for_all_acked before returning.
The payload being delivered is a single (int64 tid, string name) pair on the same host, so the rclcpp/DDS round-trip is dramatically heavier than what the use case requires. In practice this adds multi-second startup latency to every non-ROS worker that the configurator manages, which is visible at application boot and at every dynamic thread spawn.
Suggested direction
Replace the rclcpp pub/sub path with a lightweight single-host IPC (e.g. an abstract Unix domain SOCK_DGRAM socket) so that spawn_non_ros2_thread can deliver the (tid, name) pair without creating a DDS Participant or paying discovery / ack latency.
Related
Summary
spawn_non_ros2_threadinagnocast_cie_thread_configuratorcurrently uses an rclcpp publisher/subscriber pair to send a single(thread_id, thread_name)payload from each non-ROS worker thread tothread_configurator_node. Because every call constructs a freshrclcpp::Context,Node, andPublisher, each non-ROS thread pays the full cost of standing up a brand-new DDS Participant just to deliver a few bytes.Problem
Each invocation of
spawn_non_ros2_thread:wait_for_all_ackedbefore returning.The payload being delivered is a single
(int64 tid, string name)pair on the same host, so the rclcpp/DDS round-trip is dramatically heavier than what the use case requires. In practice this adds multi-second startup latency to every non-ROS worker that the configurator manages, which is visible at application boot and at every dynamic thread spawn.Suggested direction
Replace the rclcpp pub/sub path with a lightweight single-host IPC (e.g. an abstract Unix domain
SOCK_DGRAMsocket) so thatspawn_non_ros2_threadcan deliver the(tid, name)pair without creating a DDS Participant or paying discovery / ack latency.Related