ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This should be ok, provided that you take care of potential concurrency issues that might arise due to your callback queues being driven by any kind of multithreaded spinners. As your callbacks could then be called in parallel, otherFunction(..) might call callback(..) at a point where callback(..) is already being executed by the callbackqueue instance(s) in your node.

If callback(..) performs any operations that must be atomic or has critical sections, you would need to add some mutual exclusion infrastructure to make sure that two calls to callback(..) can be executed in parallel.