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


Groups > comp.lang.python > #2860

Re: Copy-on-write when forking a python process

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 <modelnine@modelnine.org>
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 <modelnine@modelnine.org>
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 <BANLkTikxcTsgyK-kDQM6PWFQAScztvFh7w@mail.gmail.com>
In-Reply-To <BANLkTikxcTsgyK-kDQM6PWFQAScztvFh7w@mail.gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.156.1302284140.9059.python-list@python.org> (permalink)
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

Show key headers only | View raw


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.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Copy-on-write when forking a python process Heiko Wundram <modelnine@modelnine.org> - 2011-04-08 19:26 +0200
  Re: Copy-on-write when forking a python process jac <john.theman.connor@gmail.com> - 2011-04-08 11:34 -0700
    Re: Copy-on-write when forking a python process Heiko Wundram <modelnine@modelnine.org> - 2011-04-08 23:29 +0200
      Re: Copy-on-write when forking a python process jac <john.theman.connor@gmail.com> - 2011-04-12 14:13 -0700

csiph-web