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.043 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'expected.': 0.09; 'cc:addr :python-list': 0.11; 'changes': 0.15; 'attributes.': 0.16; 'fork': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'missing?': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'appears': 0.22; 'cc:addr:python.org': 0.22; 'initial': 0.24; 'cc:2**0': 0.24; 'pass': 0.26; 'values': 0.27; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'work.': 0.31; 'another.': 0.31; 'actual': 0.34; 'updated': 0.34; 'could': 0.34; 'subject: (': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'two': 0.37; 'that,': 0.38; 'explain': 0.39; 'itself': 0.39; 'information': 0.63; 'such': 0.63; 'happen': 0.63; 'different': 0.65; 'launches': 0.84; 'processes,': 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:content-transfer-encoding; bh=NbtJ+jKOOOfPb9EeVK9lA4gC5GETScAKawIphxdHVF8=; b=RUJ70U84Ry/up1NaRxLgpUnSzatYjNsg+c2RYgaNO9RESWXseKP9qI3+pGwbmERoVE kW709+3Elpg0pwBHHOi2aHJbFYkDH2/AcAty1wn4ZjgdTGCtdlqpe1EWIp+S0QTrJRvf h+iJCagql/zl9xyldvYY9/XNQGvmAiQzqZ5f3c8d3UBQnFD5FxXsg0BSZ52ptY/0fn/V ZrW1Bzh2q20VS4yHItODWbN2nPeSLMwVsVMsc2wi0tMAx2Rmnm54W5f85lUXDeOu4KOK BKzfpiheF7KUPpPcjcsvCiZrLAq1TjrYbZML1LAJLCHWebZ2tCMV++9eymoelK4cy4vN wIhw== MIME-Version: 1.0 X-Received: by 10.58.160.134 with SMTP id xk6mr2876683veb.64.1401811718998; Tue, 03 Jun 2014 09:08:38 -0700 (PDT) In-Reply-To: <3c0be3a7-9d2d-4530-958b-13be97db3765@googlegroups.com> References: <3c0be3a7-9d2d-4530-958b-13be97db3765@googlegroups.com> Date: Wed, 4 Jun 2014 02:08:38 +1000 Subject: Re: multiprocess (and paramiko) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401811721 news.xs4all.nl 2940 [2001:888:2000:d::a6]:53088 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72530 On Wed, Jun 4, 2014 at 1:43 AM, mennis wrote: > I was able to work around this by using a completely different design but= I still don''t understand why this doesn't work. It appears that the proc= ess that launches the process doesn't get access to updated object attribut= es. When I set and check them in the object itself it behaves as expected.= When I check them from outside the object instance I get the initial valu= es only. Could someone explain what I'm missing? > When you fork into two processes, the child gets a copy of the parent's state, but after that, changes happen completely independently. You need to use actual multiprocessing features like Queue and such to pass information from one process to another. ChrisA