
Hi,
I have a question concerning the remove function of
managed_shared_memory. Actually I am not able to remove a segment of
shared memory. See the following example. It writes 0 to the output
stream. But why?
#include

Moritz escribió:
Hi,
I have a question concerning the remove function of managed_shared_memory. Actually I am not able to remove a segment of shared memory. See the following example. It writes 0 to the output stream. But why?
In older versions, there was a but with remove that returned 0 when successful. To test you have this bug try to create_only after removing the shared memory. If successful you've bitten by this bug. Best, Ion

Hello Ion. Thanks for the quick response. I am working with boost version 1.37 and it looks like I have found the bug you described. Thank you very much. Another question concerning this topic is if there is a possibility to remove managed_shared_memory, named_mutexes or message_queues by force, that means no matter if there are processes that have mapped the memory or are working with the mutexes. It would be nice if an operation on the resource object (by a process that does not know that the resources have been removed) would then throw an exception. Is there a possibility to get that behavior? Best Regards, Moritz Ion Gaztañaga wrote:
Moritz escribió:
Hi,
I have a question concerning the remove function of managed_shared_memory. Actually I am not able to remove a segment of shared memory. See the following example. It writes 0 to the output stream. But why?
In older versions, there was a but with remove that returned 0 when successful. To test you have this bug try to create_only after removing the shared memory. If successful you've bitten by this bug.
Best,
Ion

Moritz escribió:
Hello Ion.
Thanks for the quick response. I am working with boost version 1.37 and it looks like I have found the bug you described. Thank you very much. Another question concerning this topic is if there is a possibility to remove managed_shared_memory, named_mutexes or message_queues by force, that means no matter if there are processes that have mapped the memory or are working with the mutexes.
Latest Boost versions' (1.39, 1.40) ::remove() works that way (unix way, you can unlink an in-use file) in Windows. Best, Ion
participants (2)
-
Ion Gaztañaga
-
Moritz