ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Are locks redundant for mutually exclusive callback groups?

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

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 -0600

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

Your Answer

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

Add Answer

Question Tools

3 followers

Stats

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

Seen: 91 times

Last updated: Nov 01 '21