|
Boost : |
Subject: Re: [boost] [interprocess] Sharing shared_memory_object across processes?
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2012-04-26 14:32:26
El 25/04/2012 20:26, Joseph Van Riper escribió:
> I either do not understand what I am seeing, or I may have stumbled upon a
> bug, at least in a Windows environment. Or, of course, my expectations may
> be unrealistic.
>
> The short of this is that when I create a
> boost::interprocess::shared_memory_object that isn't removed for the
> duration of the program's run, the reading program's run can't seem to open
> the shared_memory_object, despite creating a
> boost::interprocess::permissions object and calling 'set_unrestricted()'.
> I get an exception indicating that access is denied.
Sorry, but in your test the reader deletes mutexes in use and creates
them again with the same name. This means that the writer and the reader
don't shared the same mutex!
Regarding permissions, I think there is a problem in the function
"unlink_file" of boost/interprocess/detail/win32_api.hpp. It seems that
trying to to do a "normal" delete is not a good idea for already
unrestricted permission files so please comment
"if(!delete_file(filename)){"
condition. Let's see if this helps a bit.
Best,
Ion
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk