freesteel wrote: > I am trying to run a python programme embedded from C++. I want to run > the same python code concurrently in several threads. I read the manual > on embedding, especially chapter 8, and searched for relevant info on > google all afternoon, but I can't get this to work. What am I doing > wrong? I use python2.4 and vc++7 (.net). The first thread seems to work > okay, the 2nd thread crashes, but the exception information is not very > useful: > (An unhandled exception of type 'System.NullReferenceException' > occurred in pyembed_test.exe
Running one iterpreter in more than one thread is not supported. You need to create one interpreter per thread using Py_NewInterpreter (don't forget to read "Bugs and caveats" paragraph). I hope you also realize the interpreters won't share objects. -- http://mail.python.org/mailman/listinfo/python-list