Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:process': 0.07; 'subject:when': 0.07; 'proposing': 0.09; 'looked': 0.10; 'subject:python': 0.15; 'received:10.2': 0.16; 'such,': 0.16; 'too)': 0.16; 'workarounds': 0.16; 'header:In-Reply-To:1': 0.22; 'sound': 0.22; 'breaks': 0.23; 'itself,': 0.23; 'objects,': 0.23; 'problem?': 0.23; 'objects': 0.24; 'fix': 0.24; 'memory': 0.24; 'object': 0.27; "doesn't": 0.28; 'seem': 0.30; '---': 0.31; 'complete.': 0.31; 'parent': 0.31; 'semantics': 0.31; 'does': 0.31; 'child': 0.31; 'anyone': 0.31; 'to:addr:python-list': 0.32; 'initial': 0.32; "isn't": 0.34; 'reference': 0.34; 'got': 0.34; 'plans': 0.35; 'there': 0.35; 'header:User-Agent:1': 0.35; 'optimization': 0.36; 'else': 0.37; 'problems': 0.37; 'it?': 0.37; 'refer': 0.37; 'but': 0.38; 'received:org': 0.38; 'to:addr:python.org': 0.39; 'solution': 0.40; "it's": 0.40; 'become': 0.70; 'guaranteed': 0.72; '(and,': 0.84; 'cow': 0.84; 'schrieb': 0.84; 'subject:write': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=modelnine.org; s=modelnine1012; t=1302283609; bh=5gOiOC46XIG3uLyKeF3B//4dd4rkPpcVV+jdRkyXgmA=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=L0U1htbwiMx+Gnta9SR9OP36EDVV3bNNk3UDiLKzHVJHwVHQLXKRBQe03wnb1pn7Q /wqmeOKI4qTvj9/3L8CxLiAETuCzIPQ8Hwkxmb/MG1TQc+QwwJji4c5XENMOvI+EHQ vsvoBCNnW+Df1echssNowwTbABxnhaI5BzeM8Puk= Date: Fri, 08 Apr 2011 19:26:43 +0200 From: Heiko Wundram User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Copy-on-write when forking a python process References: In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 21 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302284140 news.xs4all.nl 81474 [::ffff:82.94.164.166]:42617 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2860 Am 08.04.2011 18:14, schrieb John Connor: > Has anyone else looked into the COW problem? Are there workarounds > and/or other plans to fix it? Does the solution I am proposing sound > reasonable, or does it seem like overkill? Does anyone foresee any > problems with it? Why'd you need a "fix" like this for something that isn't broken? COW doesn't just refer to the object reference-count, but to the object itself, too. _All_ memory of the parent (and, as such, all objects, too) become unrelated to memory in the child once the fork is complete. The initial object reference-count state of the child is guaranteed to be sound for all objects (because the parent's final reference-count state was, before the process image got cloned [remember, COW is just an optimization for a complete clone, and it's up the operating-system to make sure that you don't notice different semantics from a complete copy]), and what you're proposing (opting in/out of reference counting) breaks that. -- --- Heiko.