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


Groups > comp.lang.python > #61116

Re: Embedding multiple interpreters

From Gregory Ewing <greg.ewing@canterbury.ac.nz>
Newsgroups comp.lang.python
Subject Re: Embedding multiple interpreters
Date 2013-12-06 19:58 +1300
Message-ID <bgdat9FouohU1@mid.individual.net> (permalink)
References <mailman.3620.1386298086.18130.python-list@python.org>

Show all headers | View raw


Garthy wrote:
> I am running into problems when using multiple interpreters [1] and 
> I am presently trying to track down these issues. Can anyone familiar 
> with the process of embedding multiple interpreters have a skim of the 
> details below and let me know of any obvious problems?

As far as I know, multiple interpreters in one process is
not really supported. There *seems* to be partial support for
it in the code, but there is no way to fully isolate them
from each other.

Why do you think you need multiple interpreters, as opposed
to one interpreter with multiple threads? If you're trying
to sandbox the threads from each other and/or from the rest
of the system, be aware that it's extremely difficult to
securely sandbox Python code. You'd be much safer to run
each one in its own process and rely on OS-level protections.

> - I understand that for the most part only a single interpreter will be 
> running at a time due to the GIL.

Yes, as far as I can tell, there is only one GIL in a given
process.

> - I don't need to share objects between interpreters (if it is even 
> possible- I don't know).

The hard part is *not* sharing objects between interpreters.
If nothing else, all the builtin type objects, constants, etc.
will be shared.

-- 
Greg

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