简体   繁体   中英

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

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".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM