0
$\begingroup$

Rosanswers logo

If a simple node with ros::spin() in the main loop subscribes to two messages, will the message callbacks be called sequentially or be potentially processed in parallel?

Is the GlobalCallbackQueue global to all nodes/ROS, or just the node making the call?

I reviewed roscpp/Overview/Callbacks, and it indicates that there is a callback queue(s), but it doesn't confirm that one callback completes before the next callback is initiated.


Originally posted by Bart on ROS Answers with karma: 856 on 2011-04-17

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

All threading is local to processes.

All callbacks can be associated with a specific callback queue. All callbacks go into the default queue if not specified. A NodeHandle can have a custom callback queue associated with it, or specific callback registrations.

If you have a single thread servicing a callback queue. All will be serial.

Any specific callback will only be called after the last instance has finished, regardless of how many threads there are in the queue.


Originally posted by tfoote with karma: 58457 on 2011-04-17

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.