embedding python in a multi-threaded C++ application

Titus Brown t at chabry.caltech.edu
Sun Jan 13 03:24:43 EST 2002


In article <mailman.1010820622.18922.python-list at python.org>,
Jason Orendorff <jason at jorendorff.com> wrote:
>> What are the issues in having a C++ thread calling python?
>> Is there any documentation about:
>> 
>> - embedding python in C++ app?
>> - multithreading issues in python when embedded in C++?
>
>http://www.python.org/doc/current/api/threads.html
>
>The multithreading issues shouldn't be any different
>just because it's C++ as opposed to C.

In practice, the Python documents on embedding are just a starting point;
there are quite a few specific issues (how does module loading work, for
example, in the context of multiple threads?  And how about multiple
interpreters?) that in practice require a wider amount of reading.  Not
that this is bad, mind you, but the above reference isn't exactly the
only place to look, only the place to start.

Perhaps some day I'll write up my experiences with PyWX in more detail ;).
In the meantime, there's a whole bunch of source code that implements a
full multithreaded multiinterpreter embedding available at

	www.sf.net/projects/pywx/

and I'd be happy to chat about it if there are any specific questions.

cheers,
--titus



More information about the Python-list mailing list