quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Eloff" <dan.el...@gmail.com>
Subject OT: Python C API and reference counting
Date Thu, 09 Nov 2006 15:47:53 GMT
I know this isn't about mod_python, but I can think of nobody better
qualified to answer this question than mod_python developers.

If in a C function you release the GIl using begin/end allow threads,
does it change your responsibilites with regard to the reference
counts on the input parameters?

unsigned char * str;
int len;

PyArg_Parse(args, "s#", &str, &len)

Now if you do a Py_BEGIN_ALLOW_THREADS, and do something time
consuming without any python calls, can you count on str not being
deallocated somehow while you work?


View raw message