简体   繁体   中英

Boost shared memory. How many processes are currently using the shared memory?

I am sharing some memory between processes, using the boost library;

boost::interprocess::managed_shared_memory managed_shm(boost::interprocess::open_or_create, "shm", 1024);

is there a way to find out how many processes are currently accessing this memory?

If you can get the underlying SHM ID, you can use shmctl function to get the number of processes having the segment attached.

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