Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-05-01 Thread Lawrence D'Oliveiro
In message 49f729f5$0$1645$742ec...@news.sonic.net, John Nagle wrote: Linux doesn't do interprocess communication very well. ... and shared memory (unsafe). What about with a futex? -- http://mail.python.org/mailman/listinfo/python-list

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-30 Thread JanC
John Nagle wrote: Linux doesn't do interprocess communication very well. The options are pipes (clunky), sockets (not too bad, but excessive overhead), System V IPC (nobody uses that) and shared memory (unsafe). + dbus -- JanC -- http://mail.python.org/mailman/listinfo/python-list

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-28 Thread John Nagle
Gunter Henriksen wrote: If you don't want to use a 3rd party module you could use the multiprocessing module That is definitely good for when I have a tree of processes which are all Python applications. I use it for that. But I am looking for something where the Python application can

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-28 Thread Gunter Henriksen
Linux doesn't do interprocess communication very well. The options are [...] and shared memory (unsafe). I think the bar has to be set pretty high to say shared memory is too unsafe an approach for active entities to communicate. If you're using CPython, don't worry about socket overhead.

Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Gunter Henriksen
I am interested in the lightest mechanism to use in a Python application for mutex/wait/notify between processes, one of which may be a program which does not have a shared ancestral benefactor, or may not be a Python program at all. I would ideally like to have something which does not need to

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Lawrence D'Oliveiro
In message mailman.4645.1240869985.11746.python-l...@python.org, Gunter Henriksen wrote: I would ideally like to have something which does not need to make a system call in an uncontended case for the mutex. In Linux you could use a futex. --

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Paul Rubin
Gunter Henriksen gunterhenrik...@gmail.com writes: A thin layer over pthreads would be nice, or which is using POSIX semaphores/queues would be ok.  I can use mmap for shared memory; that is not problem. The synchronization is where I need help. Try this:

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Paul Rubin
Gunter Henriksen gunterhenrik...@gmail.com writes: Try this: http://nikitathespider.com/python/shm/ I took a look at that (especially the posix_ipc at http://semanchuk.com/philip/posix_ipc/). I am hoping not to plug something underneath the Python VM; I would rather use a socket, or use

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Gunter Henriksen
Try this: http://nikitathespider.com/python/shm/ I took a look at that (especially the posix_ipc at http://semanchuk.com/philip/posix_ipc/). I am hoping not to plug something underneath the Python VM; I would rather use a socket, or use signals. If I were to use a C library, I imagine I would

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Philip Semanchuk
On Apr 27, 2009, at 8:45 PM, Gunter Henriksen wrote: Try this: http://nikitathespider.com/python/shm/ I took a look at that (especially the posix_ipc at http://semanchuk.com/philip/posix_ipc/). Hej Gunter, The posix_ipc and sysv_ipc modules both do what you're asking for. Shm does too

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Gunter Henriksen
If you don't want to use a 3rd party module you could use the multiprocessing module That is definitely good for when I have a tree of processes which are all Python applications. I use it for that. But I am looking for something where the Python application can interact conveniently with an

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Gunter Henriksen
Try this: http://nikitathespider.com/python/shm/ I am hoping not to plug something underneath the Python VM; I would rather use a socket, or use signals. I'm not sure what you mean. It's just an extension module that you'd import like any of the stdlib modules. I cannot import it

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Aaron Brady
On Apr 28, 12:20 am, Gunter Henriksen gunterhenrik...@gmail.com wrote: If you don't want to use a 3rd party module you could use the multiprocessing module That is definitely good for when I have a tree of processes which are all Python applications.  I use it for that.  But I am looking

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Paul Rubin
Gunter Henriksen gunterhenrik...@gmail.com writes: Indeed, but I can import signal or import socket wherever I go, without worrying about requiring (or worse yet, having to bundle) a CPython plugin Oh I see what you mean, yes, it's a recurring problem. It would be nice if the mmap module