A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/091330.html below:

Use of Py_BEGIN_ALLOW_THREADS?

Use of Py_BEGIN_ALLOW_THREADS? Use of Py_BEGIN_ALLOW_THREADS?Bill Eldridge bill at rfa.org
Wed Apr 11 05:56:47 EDT 2001
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?

Py_BEGIN_ALLOW_THREADS
call_callback(item1,item2,&c_callback)
Py_END_ALLOW_THREADS

c_callback(...) {
  call_callback2(item3, item4, &c_callback2)
}

and so on?  Basically it's hard to get diagnostics
on where/why it disappears.  Any thoughts?

Thanks,
Bill

--
Bill Eldridge
Radio Free Asia
bill at rfa.org

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4