[Python-ideas] In-process interpreters

Sérgio Surkamp sergio at gruposinternet.com.br
Wed Nov 17 13:39:38 CET 2010


Em Wed, 17 Nov 2010 13:56:43 +0530
Swapnil Talekar <swapnil.st at gmail.com> escreveu:

> We need to run multiple interpreters in-process. Which means we need
> to create completely independent environments for each interpreter
> using some very dirty hack. Since Python inherently does not support
> this. Python threads( created using python's threading module ) are
> not of much help because of the GIL.
> For this purpose the solution we have adopted is moving all the
> mutable python globals to heap.

What about using multiple processes? You could use pipes to exchange
information between them.

http://docs.python.org/library/subprocess.html
http://docs.python.org/library/os.html#os.fork (Unix only)

Regards,
-- 
  .:''''':.
.:'        `     Sérgio Surkamp | Gerente de Rede
::    ........   sergio at gruposinternet.com.br
`:.        .:'
  `:,   ,.:'     *Grupos Internet S.A.*
    `: :'        R. Lauro Linhares, 2123 Torre B - Sala 201
     : :         Trindade - Florianópolis - SC
     :.'
     ::          +55 48 3234-4109
     :
     '           http://www.gruposinternet.com.br



More information about the Python-ideas mailing list