problem implementing a threaded module

Stephane Conversy conversy at lri.fr
Thu Apr 20 13:10:17 EDT 2000


Hi. I'm trying to implement a C module that launches a pthread
and calla a python call-back.

I think it's not a big deal for those who know how to do it, but
my implementation does not work (seg fault).

I didn't really understand what to do exaclty:
should I create an interpreter state for each thread, using
PyInterpreterState_New ?
should I create a thread state for each thread with  PyThreadState_New and
swap
it with the current thread state ?

I can't figure out what to do. Is there any example that just creates a
pthread
and calls a python func ?

Thank you.

--
Stéphane Conversy
http://www-ihm.lri.fr/~conversy/
mailto:conversy at lri.fr






More information about the Python-list mailing list