Detached interpreter threads

T

The Dark Seraph

Hi-

I am writting an application in C++ that I am attempting to embed an
interpreter in. I know about how I need to protect the interpreter
internals from mean nasty threads in my program, but I am runnning
across a problem I don't quite understand.

Here is my flow of control:

C++ Main starts up
Py_Initialize() is run
PyEval_InitThreads() is run ( or whatever it is called )
PyRun_SimpleFile() is called with Loader.py
Loader.py begins to execute:
Loader.py prints it is running
Loader.py does a few imports
Loader.py does a start_new_thread()
Loader.py says it is done running
Control returns to C++ program

The problem is that the new thread started by Loader doesn't every
have its entry point called. I made the very first line a print,
but that didn't ever get executed. If I run Loader.py on its own, it
works just fine and dandy. I have the same construct in Jython that
works perfectly, so I am kind of puzzled as to why interpreter threads
don't run.

Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top