79657315

Date: 2025-06-07 20:52:13
Score: 1.5
Natty:
Report link

Multi-threading in python does not function due to the Python GIL - Global Interpret Lock.
Accordingly the ROS2 multithreaded executor does not function correctly.

You will see superior performance and substantially less jitter from the single-threaded executor. You must accordingly write your code without blocking which makes it very difficult (impossible?) to implement ROS Actions et. al. properly.

Multi-threading can only help in Python if it is done in C/C++ code you call from a Python library so that the C/C++ side is the part that is parallel.

This is why all of the web architectures that use Python in the middleware all use multiple processes and not threads.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Quazil