I am using boost::interprocess to attempt to share a block of memory between >2 processes. I am allocating the memory using:
std::unique_ptr<boost::interprocess::managed_shared_memory> tableStorage_;
When running the code inside docker/podman, I have to run with --ipc=host
to be able to execute the code, else it will just happily sit there waiting forever. Not sure for what though.
I am seeing the same behavior in and outside docker/podman. Sometimes when the code exits it doesn't seem to not cleanup /dev/shm
if it is the last process with a hold on that memory. Is there a way to make sure that /dev/shm
gets cleaned out when the process exits and it is the last process to hold onto the file in /dev/shm
?
Thanks!