system wide mutex

Roy Smith roy at
Sun Feb 9 15:45:52 CET 2014

In article <mailman.6578.1391943647.18130.python-list at>,
 Skip Montanaro <skip at> wrote:

> > Which one is most recommended to use for mutex alike locking to
> > achieve atomic access to single resource:
> >
> > - fcntl.lockf
> > - with O_SHLOCK and O_EXLOCK
> > -
> > -
> > - any other ?
> As the author of lockfile, I can tell you it only implements advisory
> locking. All programs needing to access the locked resources must
> cooperate.

This is true of all mutexes, no?

We needed a mutex that worked across multiple machines, so we ended up 
implementing a mutex in memcache.  We based ours on, but if you google for "memcache mutex 
python", you'll find a number of implementations.

More information about the Python-list mailing list