Memory mapped File (Python win32 extensions)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Srijit Kumar Bhadra

    #1

    Memory mapped File (Python win32 extensions)

    Hello,
    I see that it is possible to use mmapfile.pyd of win32all. The same is
    mentioned in http://www.python.org/windows/win32/#mmapfile.

    Unfortunately I could not trace any example using mmapfile.

    Any example or link to an example will be of help. I am interested to
    learn how to achieve efficient sharing of data between separate
    processes using mmapfile.

    Regards,
    /Srijit

  • Thomas Heller

    #2
    Re: Memory mapped File (Python win32 extensions)

    "Srijit Kumar Bhadra" <srijit@yahoo.c om> writes:
    [color=blue]
    > Hello,
    > I see that it is possible to use mmapfile.pyd of win32all. The same is
    > mentioned in http://www.python.org/windows/win32/#mmapfile.
    >
    > Unfortunately I could not trace any example using mmapfile.
    >
    > Any example or link to an example will be of help. I am interested to
    > learn how to achieve efficient sharing of data between separate
    > processes using mmapfile.[/color]

    You can even create a shared memory mapped file for sharing data
    between processes on Windows in pure Python. It's not really obvious
    from the mmap description, but calling

    shmem = mmap.mmap(0, 32000, "spam")

    creates (or opens, if it already exists) a shared memory block,
    not based an any existing file. In other words, the fileno (first
    parameters) must be 0, and the last one specifies the system wide name
    of the shared memory block.

    Thomas

    Comment

    Working...