Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2a.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.042 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'suppose': 0.07; 'sure,': 0.09; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mean,': 0.16; 'process?': 0.16; 'raised.': 0.16; 'subject:based': 0.16; 'wrote:': 0.18; 'finished': 0.19; 'written': 0.21; '>>>': 0.22; 'cc:addr:python.org': 0.22; '(or': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'though.': 0.31; 'file': 0.32; 'thanks!': 0.32; 'could': 0.34; 'problem.': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'possible': 0.36; 'application': 0.37; 'files': 0.38; 'pm,': 0.38; 'sure': 0.39; 'matter': 0.61; 'simple': 0.61; 'within': 0.65; 'yes': 0.68; 'yourself': 0.78; '2015': 0.84; 'conflicts': 0.84; 'subject:looking': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=FPhqhpO8/liOIZWBHaGg/k+IcxwGLOK/XJ3J6FdIAQg=; b=r84bLdpH/4ewlqPlGjG0KRxGeXTQgDUyXEexl0gvhzjYmLLZ1o7sf1BqgBeia0QmG4 I9Dn4C65jnyRrF1oxq1jpBIm0F8bREN+uN342oErTkgN2pDgJlqiAGKOZQvLtDikdOmN rAua4MgFzrfTJQqA1ZUiTpA/9m+0y1R4gpTnLj7cp/i8KnbHieVXFaoZdb3f+2Qp4K4J WcVPTXabSKt7wpTkvdPfYQh7aVT57Fg2yFl3BGvqZkMuMwTIcN87lAPTm5Tb7VwQiDMY OPt1nWvjXjWGdVIKbt8yKuStq3gvcByFRDEA97E4Ar1ZL1ny+1/RGQSvn0Hs8L0ROT0l Insw== MIME-Version: 1.0 X-Received: by 10.107.16.32 with SMTP id y32mr28729174ioi.53.1429019141135; Tue, 14 Apr 2015 06:45:41 -0700 (PDT) In-Reply-To: <552d115e$0$13010$c3e8da3$5496439d@news.astraweb.com> References: <552d115e$0$13010$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 14 Apr 2015 23:45:41 +1000 Subject: Re: Pickle based workflow - looking for advice From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1429019150 news.xs4all.nl 2932 [2001:888:2000:d::a6]:50998 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88958 On Tue, Apr 14, 2015 at 11:08 PM, Steven D'Aprano wrote: > On Tue, 14 Apr 2015 05:58 pm, Fabien wrote: > >> On 14.04.2015 06:05, Chris Angelico wrote: >>> Not sure what you mean, here. Any given file will be written by >>> exactly one process? No possible problem. Multiprocessing within one >>> application doesn't change that. >> >> yes that's what I meant. Thanks! > > It's not that simple though. If you require files to be written in precisely > a certain order, then parallel processing requires synchronisation. > > Suppose you write A, then B, then C, then D, each in it's own process (or > thread). So the B process has to wait for A to finish, the C process has to > wait for B to finish, and so on. Otherwise you could find yourself with C > reading the data from B before B is finished writing it. Sure, which is a matter of writer/reader conflicts on a single file - nothing to do with "writing multiple files simultaneously" which was the question raised. ChrisA