Skip to content

spawn_non_ros2_thread incurs multi-second DDS overhead per call to report a single (tid, name) pair #53

@atsushi421

Description

@atsushi421

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions