Use of Py_BEGIN_ALLOW_THREADS?

Donn Cave donn at oz.net
Thu Apr 12 00:17:31 EDT 2001


Quoth Bill Eldridge <bill at rfa.org>:
| I'm calling a C function from Python,
| and that C function in turn calls
| another C function #2 with a C callback
| function.
|
| Somewhere it seems like with threads
| it disappears - all of the debug
| messages in function #2 come out,
| but the C callback never gets called.
|
| I try to surround the original call of function
| #2 with:
|
| Py_BEGIN_ALLOW_THREADS
| c_function_2()
| Py_END_ALLOW_THREADS
|
| which compiles and runs, but still doesn't work.
|
| Do I need to surround the actual call of the
| callback routine?  And if that callback calls
| another callback?

Not at all.  It makes no difference who's calling
whom, as long as it's all C - i.e., no Python
executed from c_function_2.

	Donn Cave, donn at oz.net



More information about the Python-list mailing list