Which is a better solution to concurrency given a multi-core computer, launch nodes as separate process or as separate threads within a process

asked 2023-06-19 06:52:01 -0500

Alexander gravatar image

Currently on ROS2 Foxy with a 4 core system on an arm based computer.

I have an AMR full stack to deploy on to the target hardware and am running into concurrency problems. As you would expect there are many nodes talking to each other with a mixture of msg callbacks, timers and services.

Deadlocks seem to have been resolved by launching some nodes a separate processes, though I believe now that there are some preemption issues as far too much CPU is being used and the code is not functioning well. There are quite a few nodes running that are tying to keep 'many plates' spinning in the air.

So my general question is.. Which is a better solution to concurrency given a multi-core computer, launch nodes as separate processes or as separate threads within a process?

edit retag flag offensive close merge delete