Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '(at': 0.04; 'cc:addr :python-list': 0.11; 'blocks': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'roy': 0.16; 'prevent': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'file,': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'skip': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'right.': 0.26; 'second': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'flags': 0.31; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'first': 0.61; 'smith': 0.68; 'closes': 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=CV6qTM0yvdoprzJkHSFGoOcm+2xjy0FVliRcfGOa2Zw=; b=Lfcpc6xJiKqBKjSWWw8zeryQh+JtDghBLVtB9JWlxJTIIjDngtEJsTS1epzUTw+KAm cEIfSeSO4wgEw9caZsmLQJeXdTVjoS9X909/zmon6knDxU+gI6zC72irRYJAK6t+tBA/ +Zu4ex5Rgh3XYpwqzfY+Asa1DL2ZL3a/hOMy3XGd18azx0gIT7/bP9939ZQOjGiTvR8i mw5w3idnYDRqxbdbYB4yfgUOYulShBNmZAMXd1wV+yFtA3laIJ7bHTm4S/fho4I/fE1x Ymu+cM8YM+r/eDr171yNRUslYNiMK1z+ZUmaoFIf+1uR1YU0WMTVKZrCpPwk0bOcTurX tN7w== MIME-Version: 1.0 X-Received: by 10.58.133.15 with SMTP id oy15mr19117026veb.19.1391960400709; Sun, 09 Feb 2014 07:40:00 -0800 (PST) Sender: skip.montanaro@gmail.com In-Reply-To: References: Date: Sun, 9 Feb 2014 09:40:00 -0600 X-Google-Sender-Auth: 7eYHEp69dKlUQYflH-mfFUyEf3U Subject: Re: system wide mutex From: Skip Montanaro To: Roy Smith Content-Type: text/plain; charset=UTF-8 Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391960403 news.xs4all.nl 2975 [2001:888:2000:d::a6]:58704 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65765 On Sun, Feb 9, 2014 at 8:45 AM, Roy Smith wrote: > This is true of all mutexes, no? Hmmm... You might well be right. I thought that use of the O_EXLOCK flag in the open(2) system call would prevent other processes from opening the file, but (at least on my Mac) it just blocks until the first process closes the file. Perhaps there are some other flags you can use to cause the second open(2) call to error out. Skip