Ask Your Question
1

roscpp message callback threading?

asked 2011-04-17 14:10:38 -0500

updated 2011-04-17 15:52:50 -0500

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.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2011-04-17 16:15:06 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Stats

Asked: 2011-04-17 14:10:38 -0500

Seen: 450 times

Last updated: Apr 17 '11