Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65763

Re: system wide mutex

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!roy
From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: system wide mutex
Date Sun, 09 Feb 2014 09:45:52 -0500
Organization PANIX Public Access Internet and UNIX, NYC
Lines 22
Message-ID <roy-960294.09455209022014@news.panix.com> (permalink)
References <cf62da1e-45f0-4ace-924a-b3035063c71e@googlegroups.com> <mailman.6578.1391943647.18130.python-list@python.org>
NNTP-Posting-Host localhost
X-Trace reader1.panix.com 1391957153 13847 127.0.0.1 (9 Feb 2014 14:45:53 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Sun, 9 Feb 2014 14:45:53 +0000 (UTC)
User-Agent MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Xref csiph.com comp.lang.python:65763

Show key headers only | View raw


In article <mailman.6578.1391943647.18130.python-list@python.org>,
 Skip Montanaro <skip@pobox.com> wrote:

> > Which one is most recommended to use for mutex alike locking to
> > achieve atomic access to single resource:
> >
> > - fcntl.lockf
> > - os.open() with O_SHLOCK and O_EXLOCK
> > - https://pypi.python.org/pypi/lockfile/0.9.1
> > - https://pypi.python.org/pypi/zc.lockfile/1.1.0
> > - 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 
http://tinyurl.com/lybx2kl, but if you google for "memcache mutex 
python", you'll find a number of implementations.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

system wide mutex Asaf Las <roegltd@gmail.com> - 2014-02-09 02:39 -0800
  Re: system wide mutex Asaf Las <roegltd@gmail.com> - 2014-02-09 03:00 -0800
  Re: system wide mutex Skip Montanaro <skip@pobox.com> - 2014-02-09 05:00 -0600
    Re: system wide mutex Asaf Las <roegltd@gmail.com> - 2014-02-09 03:07 -0800
    Re: system wide mutex Roy Smith <roy@panix.com> - 2014-02-09 09:45 -0500
      Re: system wide mutex Skip Montanaro <skip@pobox.com> - 2014-02-09 09:40 -0600
      Re: system wide mutex Chris Angelico <rosuav@gmail.com> - 2014-02-10 09:09 +1100
  Re: system wide mutex Marko Rauhamaa <marko@pacujo.net> - 2014-02-09 18:14 +0200
    Re: system wide mutex Asaf Las <roegltd@gmail.com> - 2014-02-09 09:39 -0800
  Re: system wide mutex Grant Edwards <invalid@invalid.invalid> - 2014-02-10 17:00 +0000
  Re: system wide mutex Miki Tebeka <miki.tebeka@gmail.com> - 2014-02-10 09:46 -0800

csiph-web