开发者

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

开发者 https://www.devze.com 2023-03-18 04:40 出处:网络
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);

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 h开发者_开发问答ow 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号