Multiple independent Python interpreters in a C/C++ program?

skip at skip at
Fri Apr 11 18:24:33 CEST 2008

This question was posed to me today.  Given a C/C++ program we can clearly
embed a Python interpreter in it.  Is it possible to fire up multiple
interpreters in multiple threads?  For example:

    C++ main
        thread 1
        thread 2

Do I wind up with two completely independent interpreters, one per thread?
I'm thinking this doesn't work (there are bits which aren't thread-safe and
are only protected by the GIL), but wanted to double-check to be sure.



More information about the Python-list mailing list