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


Groups > comp.lang.python > #65740

Re: system wide mutex

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.074
X-Spam-Evidence '*H*': 0.85; '*S*': 0.00; 'url:pypi': 0.03; 'implements': 0.09; 'cc:addr:python-list': 0.11; '"system': 0.16; 'fixing.': 0.16; 'flavors': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; '(you': 0.16; 'sender:addr:gmail.com': 0.17; 'written': 0.21; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'languages': 0.32; 'url:python': 0.33; 'bugs': 0.33; 'beyond': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'url:org': 0.36; 'that,': 0.38; 'reported': 0.39; 'enough': 0.39; 'most': 0.60; 'tell': 0.60; 'identify': 0.61; 'face': 0.64; 'needing': 0.65; 'to:addr:gmail.com': 0.65; 'url:0': 0.67; 'advisory': 0.84; 'atomic': 0.84; 'locked': 0.84; 'nfs': 0.84; 'subject:system': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZyT3+GKqUv2QFnnA/wXSZokyHD9TjcThfYlWTXKq7D0=; b=EWC63wOFR65t3FV7nLvTSV4MEzE1s6uMf+YUZ4plZTGeACiyiXZeT411mqfCnRO2s7 VQUzbhrjnKG/pOtL5BUvM9Tp/VCD+M/pOS/fy8qGqG0wN//A7drOXw0+//NicS+/WfCt 5oOzTdjM5wnkgYe5CfcZcPBIXZc0nrzrE9ZoeG/7YJOgi9r4RrN3oFEQfFeO4acKophG xRd4u7DXLvHZ1G2c1msIOcpq8KYvmzw9+899NA5OCUizeQpChms/MeOCN6kN2oc7SMI7 bshGGYwM1ebD5mU7FGNTeYMUUsosh86QcDfIO9bD7duKhUctQvVAMnZ9jjRohvJKFlPO 7S6Q==
MIME-Version 1.0
X-Received by 10.221.40.10 with SMTP id to10mr1233985vcb.22.1391943639935; Sun, 09 Feb 2014 03:00:39 -0800 (PST)
Sender skip.montanaro@gmail.com
In-Reply-To <cf62da1e-45f0-4ace-924a-b3035063c71e@googlegroups.com>
References <cf62da1e-45f0-4ace-924a-b3035063c71e@googlegroups.com>
Date Sun, 9 Feb 2014 05:00:39 -0600
X-Google-Sender-Auth z0un34v6qQEEP7Pbcs0e4D4sNHw
Subject Re: system wide mutex
From Skip Montanaro <skip@pobox.com>
To Asaf Las <roegltd@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6578.1391943647.18130.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391943647 news.xs4all.nl 2913 [2001:888:2000:d::a6]:50833
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65740

Show key headers only | View raw


> 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. It also has bugs which have been reported which I have yet
to spend any time fixing.

Beyond that, your question isn't really detailed enough to answer
completely. You don't identify what sort of systems you need this to
work on (Windows, Mac, various flavors of Unix?), whether programs
written in other languages will be involved (you did say "system
wide"), and whether you need to use it in the face of network file
systems like NFS or Samba.

Skip

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