[Python-ideas] Adding shm_open to mmap?

Mike Meyer mwm at mired.org
Wed Feb 15 05:10:11 CET 2012


On Wed, 15 Feb 2012 13:07:54 +1000
Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Wed, Feb 15, 2012 at 12:25 PM, Mike Meyer <mwm at mired.org> wrote:
> > On Wed, 15 Feb 2012 10:07:23 +1000
> > Nick Coghlan <ncoghlan at gmail.com> wrote:
> > As such, it should have shm_open
> > and shm_unlink, so the market wouldn't be appropriate.
> In this case, it sounds like Windows may already have a roughly
> equivalent mechanism in mmap, so cross-platform support may be
> feasible. If that's the case, a marker won't be needed.

The "tagname" feature in the windows version uses ref counting to free
the shared segment when no one is using it.

shm_open requires someone to call shm_unlink, but doesn't actually
remove it until there are no more references to it. However you can't
shm_open it again after shm_unlink'ing (expected on Unix, and verified
on my FBSD box).

We could sorta-kinda emulate the windows "tagname" behavior using
shm_open.

I'd prefer to provide shm_open on Windows if at all possible. The
"sorta-kinda" bothers me. That would also allow for an application to
exit and then resume work stored in a mapped segment (something I've
done before). However, setting this up on Windows isn't something I
can do.

   Thanks,
   <mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the Python-ideas mailing list