Threads on embedded Python

Ugo García plugin at supercable.es
Mon Jun 24 17:02:10 EDT 2002


Hi all. I have an applicattion who uses Python to control some processes.
I've made a little script library to work with threads and each proccess is
a Python thread. The main application make calls to Python in order to
create these proccesses. The problem is that the proccess doesn't run unless
I call Python to do something. Now in the main loop I have a line like this:
    PyRun_SimpleString("dummy=1");

This make Python the threads to run. The problem is that this is a little
slow 'cause if I call Python from tha main application too many times the
proccesses run well but not the main application, and if a make a big pause
between calls the proccesses doesn't work at a good speed. Is posible to
have some threads running in an embedded Python without making callings to
it continuosly? It would be a better idea to have another thread who's only
task is to call Python (a line that the one written before) in order to have
the Python proccesses running?

Thanks in advance,
--ugo






More information about the Python-list mailing list