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

Gunter Henriksen gunterhenriksen at
Tue Apr 28 00:06:20 CEST 2009

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 make a system call in an uncontended
case for the mutex.  In C on Linux I would use mmap
to get shared memory, then pthread_cond_wait with
a cond/mutex which has the PTHREAD_PROCESS_SHARED
attribute set.  For pthread_cond_wait, it would of
course be fine to make a system call.

I am familiar with the "multiprocessing" package for
the case of a closely related set of Python programs.
I am looking for something where the other side is
not a Python application using "multiprocessing".

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.

More information about the Python-list mailing list