Search code examples
c++boostboost-interprocess

Why do the boost interprocess named mutex docs say each process should have it's own named mutex?


I'm trying to use boost interprocess named mutex, and I'm a little confused about this line from the documentation : A mutex with a global name, so it can be found from different processes. This mutex can't be placed in shared memory, and each process should have it's own named_mutex.

I want different processes to use the same mutex, not each to have their own. What does that line mean exactly?

http://www.boost.org/doc/libs/1_63_0/doc/html/boost/interprocess/named_mutex.html


Solution

  • That seems to be badly worded. It should read something like:

    ... and each process should have it's own named_mutex class instance.

    Also have a look at named_mutex example usage here. You will need to scroll down to "named mutex example".