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


Groups > comp.lang.python > #61126

Re: Embedding multiple interpreters

Path csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.035
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'scripts': 0.03; 'solution,': 0.09; 'cc:addr:python-list': 0.11; 'thread': 0.14; 'another?': 0.16; 'easier.': 0.16; 'fiddle': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'interpreter;': 0.16; 'limit.': 0.16; 'python-list,': 0.16; 'supplying': 0.16; 'thread,': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'module': 0.19; 'later': 0.20; 'fit': 0.20; 'written': 0.21; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'michael': 0.29; 'chris': 0.29; 'thus': 0.29; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; 'run': 0.32; 'another': 0.32; 'running': 0.33; 'fri,': 0.33; 'minimal': 0.33; 'core': 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'interaction': 0.36; 'whilst': 0.36; 'easily': 0.37; 'problems': 0.38; 'pm,': 0.38; 'ability': 0.39; 'skip:* 10': 0.61; 'information,': 0.61; 'simply': 0.61; "you're": 0.61; 'first': 0.61; 'more': 0.64; 'chance': 0.65; 'between': 0.67; 'capable': 0.67; 'brain': 0.68; 'protect': 0.79; 'isolate': 0.84; 'malicious': 0.84; 'reasons,': 0.91; 'to:none': 0.92; '2013': 0.98
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=UTZoL/40H5XoNw597/yygnqSGoyQkzdodtgWDcO8F0U=; b=XlNwLNcx0CILh/2+5sDisIy7Fk5FuFx7QMMs4umZDCBJO6xY0AkGYO7ulYovfqWy6S HqczY5HCdBHFusdKz+Kg3/G55Q+f5uU4ZBX/ztD9kp9qPwG6BP4vnF9M54NKSRfO/DXN hE/rFScxJYLEJPr//QlW0BoP2jeyX3LSo9B7IFD+sLBN5QkmVPJrQ409qwn0dd2D7YVA lfzbyPu55WgeKa81rGlFVnvt6HWKJ90tEAnoplaTlOCqJKZq2JvLi3snSEXGb9h/DOuL sYyG0v5FOMccBnS9avcx+azFrnMa7LVhYj8/8ZprwgQVBpWGN+3/0HqBS15lUDuiL/gD pwKw==
MIME-Version 1.0
X-Received by 10.66.66.234 with SMTP id i10mr2693047pat.127.1386318799527; Fri, 06 Dec 2013 00:33:19 -0800 (PST)
In-Reply-To <52A183F8.7000807@entropicsoftware.com>
References <mailman.3620.1386298086.18130.python-list@python.org> <bgdat9FouohU1@mid.individual.net> <52A183F8.7000807@entropicsoftware.com>
Date Fri, 6 Dec 2013 19:33:19 +1100
Subject Re: Embedding multiple interpreters
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3630.1386318802.18130.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1386318802 news.xs4all.nl 2902 [2001:888:2000:d::a6]:38396
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:61126

Show key headers only | View raw


On Fri, Dec 6, 2013 at 6:59 PM, Garthy
<garthy_nhtyp@entropicsoftware.com> wrote:
> Hi Chris (and Michael),

Hehe. People often say that to me IRL, addressing me and my brother.
But he isn't on python-list, so you clearly mean Michael Torrie, yet
my brain still automatically thought you were addressing Michael
Angelico :)

> To allow each script to run in its own environment, with minimal chance of
> inadvertent interaction between the environments, whilst allowing each
> script the ability to stall on conditions that will be later met by another
> thread supplying the information, and to fit in with existing
> infrastructure.

Are the scripts written cooperatively, or must you isolate one from
another? If you need to isolate them for trust reasons, then there's
only one solution, and that's separate processes with completely
separate interpreters. But if you're prepared to accept that one
thread of execution is capable of mangling another's state, things are
a lot easier. You can protect against *inadvertent* interaction much
more easily than malicious interference. It may be that you can get
away with simply running multiple threads in one interpreter;
obviously that would have problems if you need more than one CPU core
between them all (hello GIL), but that would really be your first
limit. One thread could fiddle with __builtins__ or a standard module
and thus harass another thread, but you would know if that's what's
going on.

ChrisA

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


Thread

Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-06 13:04 +1030
  Re: Embedding multiple interpreters Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-06 19:58 +1300
    Re: Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-06 18:29 +1030
      Re: Embedding multiple interpreters Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-07 11:09 +1300
        Re: Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-07 11:27 +1030
    Re: Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-06 18:51 +1030
    Re: Embedding multiple interpreters Chris Angelico <rosuav@gmail.com> - 2013-12-06 19:33 +1100
    Re: Embedding multiple interpreters Chris Angelico <rosuav@gmail.com> - 2013-12-06 20:27 +1100
    Re: Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-06 20:05 +1030
      Re: Embedding multiple interpreters Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-07 11:23 +1300
        Re: Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-07 11:01 +1030
    Re: Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-06 20:14 +1030
    Re: Embedding multiple interpreters Tim Golden <mail@timgolden.me.uk> - 2013-12-06 10:17 +0000
    Re: Embedding multiple interpreters Chris Angelico <rosuav@gmail.com> - 2013-12-06 22:57 +1100
    Re: Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-07 00:26 +1030
    Re: Embedding multiple interpreters Garthy <garthy_nhtyp@entropicsoftware.com> - 2013-12-07 00:34 +1030

csiph-web