multi-thread python interpreaters and c++ program
lie.1296 at gmail.com
Tue Jun 9 12:41:26 EDT 2009
> hi, all
> I am ruuning a c++ program (boost python) , which create many python
> interpreaters and each run a python script with use multi-thread
> when the c++ main program exit, I want to shut down python
> interpreaters, but it crashed. I have googled a lot but cant get any clue.
> here is my code, your suggestion will be greatly appreciated.
There is no clean way to terminate a thread cleanly from outside. You
need to let the thread terminates by itself. If it is a pure python
code, this can be done by one of:
1) setting a global/thread stop value that is checked by each threads
2) inserting a QUIT event to the event-loop
I have never used boost before, so I don't know what it can and cannot
do from outside the python's interpreter. However, this should give you
an idea of what to do...
More information about the Python-list