I made some test and I was able to create and remove boost::interprocess::shared_memory_object in a C++/CLI executable without problems. In a C++/CLI dll plugin I'm only able to create the boost::interprocess::shared_memory_object but the removal fails. I verified that the file exists at the time of removal - it is present in boost::interprocess folder in a subfolder named "20110606204418.125000". The memory hasn't been mapped by any other process. Any ideas what might be the cause? At the beginning I thought it may have something to do with the project being a dll and targeting CLR but honestly I don't know. EDIT: the removal code is called by a different thread than the creation code - is this disallowed?
Asked
Active
Viewed 956 times
0
-
It seems like it could be OK to remove in a different thread, so long as you synchronize the operations to avoid removing while other operations on the same thing are in progress. – John Zwinck Jun 07 '11 at 01:24
1 Answers
0
During debugging I noticed that the file path that is to be removed inside boost::interprocess::shared_memory_object::remove is different from the file created by boost::interprocess::shared_memory_object constructor - the path to be removed points at the root of "boost_interprocess" folder while the actually created file is in the "boost_interprocess/20110606204418.125000" folder. So I reported a bug to boost. We will see what they do about it.

andriej
- 2,118
- 3
- 22
- 28