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


Groups > comp.lang.python > #26033

Re: reloading code and multiprocessing

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <andrea.crotti.0@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'socket': 0.05; 'correct.': 0.07; 'subject:code': 0.07; 'port,': 0.09; 'subject:skip:m 10': 0.09; 'weeks,': 0.09; 'cc:addr:python-list': 0.10; 'anyway': 0.11; 'language': 0.14; 'again..': 0.16; 'sys.modules': 0.16; 'parse': 0.22; 'defined': 0.22; 'cc:2**0': 0.23; 'example': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'idea': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'separate': 0.27; 'have,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'run': 0.28; 'fighting': 0.29; 'protocol.': 0.29; 'url:mailman': 0.29; 'probably': 0.29; "i'm": 0.29; 'figure': 0.30; 'point': 0.31; 'problem.': 0.32; 'url:python': 0.32; 'launch': 0.32; 'url:listinfo': 0.32; 'another': 0.33; 'that,': 0.34; 'received:google.com': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'url:org': 0.36; 'should': 0.36; 'communicate': 0.37; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'some': 0.38; 'instead': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'url:mail': 0.40; 'think': 0.40; 'first': 0.61; 'hear': 0.63; 'listens': 0.84; 'running,': 0.84; 'glad': 0.86
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:to :cc:content-type; bh=xmpMn3o49vkmQngEKPNzfzY86q2jOZyR5Q4o9ku4fJY=; b=rKwWzICGqOSOT1dAfCKdCRFDCRprGeN8A/OnHPg1Kp7LVSpl1pneVYfIO/Zdzvdyuf f+nfCHvrL2/2YUjGe0rcbVboqtyTA9B10chq6NNzki7tEjdb0mm8U5VBb6vyyAF4GA0x kbcnie2/a4AnnQ5dE5x7EC2A7IxKFIZNT3XaMdbE7XEcJMBLsaY5RBwhMsU/k/bRepZY ol3DMqOh2bzlMlrgXaVgonP+hk5RnuKPPIy5gdevOFdSGsnzwt1j2ZgTKf0aDMRr8f0a so+ZruOaNpyJchp/rQB6TvjY5NVYn8CoKuPb+DrTueqFj6hhCZjW/rwgLXaVOsRE22V8 VfwA==
MIME-Version 1.0
In-Reply-To <CAPTjJmrDqZWH0OBX1ExKYc0csieQvV0Kk3CVRNzbMmttmYKpjA@mail.gmail.com>
References <CAF_E5Jb=_H1D9YwLWGzE+D40U9ji1kFzo1hz=VwB3yzb8=43CA@mail.gmail.com> <CAPTjJmoUkKCe3q_qa7iACw0B0oVdZB-_Mo7xvgJT0nEyaOTdwg@mail.gmail.com> <CAF_E5Ja+3wMdm-jvx9C3fWk9Nwrreu7Q6r9FDwPr4YDFWt5gVQ@mail.gmail.com> <CAPTjJmrDqZWH0OBX1ExKYc0csieQvV0Kk3CVRNzbMmttmYKpjA@mail.gmail.com>
Date Wed, 25 Jul 2012 11:46:04 +0100
Subject Re: reloading code and multiprocessing
From andrea crotti <andrea.crotti.0@gmail.com>
To Chris Angelico <rosuav@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc python-list@python.org
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.2567.1343213167.4697.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1343213167 news.xs4all.nl 6938 [2001:888:2000:d::a6]:52673
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:26033

Show key headers only | View raw


2012/7/23 Chris Angelico <rosuav@gmail.com>:
>
> That would probably be correct. However, I still think you may be
> fighting against the language instead of playing to its strengths.
>
> I've never fiddled with sys.modules like that, but I know some have,
> without problem.
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list


I would also like to avoid this in general, but we have many
subprocesses to launch and some of them might take weeks, so we need
to have a process which is always running, because there is never a
point in time where we can just say let's stop everything and start again..

Anyway if there are better solutions I'm still glad to hear them, but
I would also like to keep it simple..

Another thing which now we need to figure out is how to communicate
with the live process..  For example we might want to submit something
manually, which should pass from the main process.

The first idea is to have a separate process that opens a socket and
listens for data on a local port, with a defined protocol.

Then the main process can parse these commands and run them.
Are there easier ways otherwise?

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


Thread

Re: reloading code and multiprocessing andrea crotti <andrea.crotti.0@gmail.com> - 2012-07-25 11:46 +0100

csiph-web