Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.062 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'python,': 0.02; "wouldn't": 0.14; ':-)': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'seems': 0.21; '31,': 0.24; 'header:In-Reply-To:1': 0.27; 'external': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'ok.': 0.31; 'file': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'christian': 0.38; 'process,': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'ian': 0.60; 'between': 0.67; 'mar': 0.68; '2015': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=nTprzxKFB18PHNSRSEX4BJLTaZS8lMw0xch54W4hux0=; b=z683uLo80OlJt2EkbUDdbVfK2L+yLRRro7aSlXb5loXxFh69oUgQcjMV1ACdk11Hrp HfAHFjaeLeWjtIkAWHBAkCBAwhftaxZBTza/FOB+BvyugwOOKMVkZcSkg4yanuID/E98 zgfVEK+Vr5gvxytUutD7C+PUOZHFVLmyj16AEtGnmczi8Wf0hKOODu4xIFwVc1jFDgPl Tliip522efkjZeapqAWOEL1f+Saq9uoQd2cOMmpMGWxtlroZvXC2Dxup+s21pVZ1UVGy Sfm5YsTmWtU4WdLuw29NtJgS15Vgp7FoVpAGoSEFZyjA6PPFVW8fcU3bPm5DXbLEjXpo oEPA== X-Received: by 10.70.65.73 with SMTP id v9mr27835579pds.96.1427832806623; Tue, 31 Mar 2015 13:13:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Tue, 31 Mar 2015 14:12:46 -0600 Subject: Re: Lockfile hanling To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1427832810 news.xs4all.nl 2872 [2001:888:2000:d::a6]:57089 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88402 On Tue, Mar 31, 2015 at 1:59 PM, Christian Gollwitzer wrote: > Am 31.03.15 um 21:17 schrieb Ian Kelly: >> flock locks are per-process; they won't help for synchronizing access >> between competing threads in the same process. >> > > Ok. But if it is really all in one process, then a classical mutex would do, > wouldn't it? I'm not experienced with threading in Python, but it seems from > the documentation, that threading.Lock() works like a mutex. As long as there's not *also* some other external process that needs to access the file occasionally. :-)