<br><br><div><span class="gmail_quote">2008/4/11, <a href="mailto:skip@pobox.com">skip@pobox.com</a> <<a href="mailto:skip@pobox.com">skip@pobox.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This question was posed to me today. Given a C/C++ program we can clearly<br> embed a Python interpreter in it. Is it possible to fire up multiple<br> interpreters in multiple threads? For example:<br> <br> C++ main<br>
thread 1<br> Py_Initialize()<br> thread 2<br> Py_Initialize()<br> <br> Do I wind up with two completely independent interpreters, one per thread?<br> I'm thinking this doesn't work (there are bits which aren't thread-safe and<br>
are only protected by the GIL), but wanted to double-check to be sure.<br> <br> Thanks,<br> <br> Skip<br> <br>--<br> <a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a><br>
</blockquote></div><br><br>Hi,<br><br>You will only have one the different static Python variables, so this is not possible.<br clear="all"><br>Matthieu<br>-- <br>French PhD student<br>Website : <a href="http://matthieu-brucher.developpez.com/">http://matthieu-brucher.developpez.com/</a><br>
Blogs : <a href="http://matt.eifelle.com">http://matt.eifelle.com</a> and <a href="http://blog.developpez.com/?blog=92">http://blog.developpez.com/?blog=92</a><br>LinkedIn : <a href="http://www.linkedin.com/in/matthieubrucher">http://www.linkedin.com/in/matthieubrucher</a>