Standard IPC for Python?

Aaron Brady castironpi at gmail.com
Tue Jan 13 16:54:58 EST 2009


On Jan 13, 2:04 pm, Laszlo Nagy <gand... at shopzeus.com> wrote:
> - create a wrapper, using ctypes, /windll / cdll/ to access API functions
> - use CreateFileMapping on the page file to create shared memory (a la
> windows:http://msdn.microsoft.com/en-us/library/aa366537.aspx)
> - use CreateEvent/WaitForSingleObject for signaling
> (http://msdn.microsoft.com/en-us/library/ms682396(VS.85).aspx)
> - these should be enough to implement shared memory functions and
> message queues under windows, and that might be a quick solution at
> least for me.
> - it might also be used to emulate the same posix_ipc interface, without
> any external dependency added (cygwin).
>
> All I care about is to create a working message queue. But if you think
> that this ctypes hack would be useful for other users, then I can try to
> implement it.
>
> I must tell you that I'm not very familiar with C programming (it was a
> long time ago...) and I do not own MSVC.
>
> (Hmm, can I compile this with mingw?)
>
> Laszlo

Yes.  The flags in the Extending/Embedding C++ section work with
mingw.

You can create inheritable pipes with the CreatePipe API.  'mmap'
provides shared memory, and it's a standard module.  You may also like
the 'multiprocessing' module, which comes with Python 2.6.



More information about the Python-list mailing list