C++ Binding with Threads

Pablo Yabo pablo.yabo at gmail.com
Mon Aug 13 19:42:18 CEST 2007


Hello,

I want to embed Python in an application and use an API of the application
from Python.
The application uses a library that creates several threads and I the users
of the application will write Python scripts handling this events.

The problem is that I having problems with threads. I saw that I have to
PyEval_InitThreads and then PyThreadState_New and PyThreadState_Swap from
the new thread but this way to solve the problem doesn't work for me because
I need to let 2 or more threads run at the SAME time.
The interpreter lock doesn't let them run at the same time so I'm looking
for another solution. I saw Py_NewInterpreter and I tried to use it but it
doesn't work if I don't keep the lock.

Can anyone help me to solve this issue or tell me 'Forget it!'?


Thanks on advance,
Pablo Yabo
--
http://www.nektra.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070813/a151d22c/attachment.html>


More information about the Python-list mailing list