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

Are locks redundant for mutually exclusive callback groups?

asked 2021-10-26 13:17:18 -0500

aposhian gravatar image

I have two callbacks that access a shared resource, and use a mutex to manage access to it. If I set these callbacks to run in a mutually exclusive callback group (so the executor will not schedule them to run in different threads), then I don't need a mutex anymore, right?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-11-01 09:01:17 -0500

osilva gravatar image

Hi @aposhian.

Users can use Mutually Exclusive Callback Groups in order to ensure
callbacks which operate on shared resources do not run at the same
time, without using locks.

Source

I believe you are right, Mutually Exclusive Group will do this for you.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2021-10-26 13:17:18 -0500

Seen: 244 times

Last updated: Nov 01 '21