Independent interpreters in threads

Konrad Hinsen hinsen at cnrs-orleans.fr
Mon Mar 29 17:22:06 CEST 2004


I am looking for a way to have several threads, each of which running an 
independent Python interpreter. Most of the work is done by the module 
"code", but I also need to provide each interpreter with an independent set 
of modules. I found a solution using name-mangling through the ihooks module, 
but it is not quite clear which aspects of that module can be considered 
documented, and I found that I had to update my code when moving from Python 
2.2 to Python 2.3.

Is there any cleaner solution?

In case someone wonders what this is good for, the goal is to simulate a 
parallel computing system on a single processor and in a single process space 
for debugging purposes.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------





More information about the Python-list mailing list