Re: Shared Memory Modules
From: Peter Hansen (peter_at_engcorp.com)
Date: 11/25/03
- Next message: John J. Lee: "Re: minidom nodes without a document?"
- Previous message: Jon Franz: "Re: Database connect / PDO"
- In reply to: Thomas Heller: "Re: Shared Memory Modules"
- Next in thread: Irmen de Jong: "Re: Shared Memory Modules"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 25 Nov 2003 13:57:50 -0500
Thomas Heller wrote:
>
> Peter Hansen <peter@engcorp.com> writes:
>
> > Thomas Heller wrote:
> >>
> >> steven.green3@baesystems.com (S Green) writes:
> >>
> >> > Does any one now if a shared memory module exists, written in python
> >> > for a windows platform. I now one exists for unix?
> >> >
> >> >
> >> > help most appreciated,
> >> >
> >> > S Green
> >>
> >> import mmap
> >
> > The docs suggest that mmap.mmap(x, x, mmap.MAP_SHARED) will work under
> > Unix but not Windows.
> >
> > Does the Windows version really support shared memory, or is the
> > multiple-maps-per-file feature only valid within a single process?
>
> Yes, it does. You have to give this memory block a name, though:
>
> sharedmem = mmap.mmap(0, 16384, "GlobalSharedMemory")
>
> This allows to access 16384 bytes of memory, shared across processes,
> not backed up by a file in the filesystem.
Thanks, Thomas.
In my opinion the documentation on this is entirely unclear. I attach
it for reference, but I can't offer any suggestions for improvement (as
I don't know anything about shared memory) except that even after reading
it a second time, Thomas' answer above is very much news to me:
'''tagname, if specified and not None, is a string giving a tag name
for the mapping. Windows allows you to have many different mappings
against the same file. If you specify the name of an existing tag,
that tag is opened, otherwise a new tag of this name is created. If
this parameter is omitted or None, the mapping is created without a
name. Avoiding the use of the tag parameter will assist in keeping your
code portable between Unix and Windows. '''
(from http://www.python.org/doc/current/lib/module-mmap.html)
-Peter
- Next message: John J. Lee: "Re: minidom nodes without a document?"
- Previous message: Jon Franz: "Re: Database connect / PDO"
- In reply to: Thomas Heller: "Re: Shared Memory Modules"
- Next in thread: Irmen de Jong: "Re: Shared Memory Modules"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|