threading support in python

Paul Rubin http
Tue Sep 5 22:30:36 EDT 2006


"sjdevnull at yahoo.com" <sjdevnull at yahoo.com> writes:
> > I think it's even worse. The standard Python library offers
> > shared memory, but not cross-process locks.
> 
> File locks are supported by the standard library (at least on Unix,
> I've not tried on Windows).  They work cross-process and are a normal
> method of interprocess locking even in C code.

I may be missing your point but I didn't realize you could use file
locks to synchronize shared memory in any useful way.  File locks are
usually made and released when the file is opened and closed, or at
best through flock or fcntl calls.  Shared memory locks should
generally be done with mechanisms like futex, that in the no-wait case
should not involve any system calls.



More information about the Python-list mailing list