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

Callbacks are, by definition, parallel. I don't think there is a way to make them not parallel. What you can do is to set up a system of semaphores i.e. shared variables that block execution of the other thread until the one that is being processed finishes. Anyway, be careful when blocking callbacks, if you have a blocked callback and another message arrives, it will create another instance of your callback you will have two blocked callbacks.

Callbacks are, by definition, parallel. I don't think there is a way to make them not parallel. What you can do is to set up a system of semaphores i.e. shared variables that block execution of the other thread until the one that is being processed finishes. Anyway, be careful when blocking callbacks, if you have a blocked callback and another message arrives, it will create another instance of your callback and you will have two blocked callbacks.