Embedding python with a C++ multithread apps -> pause and resume python script

Tsolakos Stavros stsolakos at patras.atmel.com
Tue Sep 10 05:35:45 EDT 2002


I have had the same problem, and I had to do some kind of trick. I had also had a problem with the CPU usage, since when such a script had been running, the CPU usage touched 100%. 

My question : I still do not know why. Does anybody?

Anyway, I have used the sys.settrace method. Each time a line of Python code is executed, my OnTrace C++ function is being called. I use yield to lower the CPU usage. You may check if the thread that called it has to pause, an dyou may pause it till it is resumed. Just an idea.

Regards

Stavros
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020910/9d76ecad/attachment.html>


More information about the Python-list mailing list