ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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.
2 | No.2 Revision |
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.