[Pyrex] Conditional compilation

khinsen at cea.fr khinsen at cea.fr
Thu Apr 7 12:04:35 CEST 2005


On Apr 7, 2005, at 9:53, David M. Cooke wrote:

> As required, no Python calls occur between the begin_allow_threads /
> end_allow_threads calls (which should just expand to
> Py_*_ALLOW_THREADS). As long as you're careful not to use C API calls
> in between, you're ok. You could even write a script to scan the
> generated result for the pattern Py.* in between *_allow_threads()
> pairs to warn you :-)
>
> Works with 0.9.3; whether you'll trust it to work for future versions
> is something you'll have to decide ;-)

With a script to check, that's perhaps a safe enough bet.
Thanks for the suggestion!

Actually, I had already been thinking about writing a script to analyze 
Pyrex-generated code to check for calls to the Python API, though 
mostly for making sure that I get the performance I expect. I regularly 
check the C code myself at the moment, but I really think that should 
be done by a computer :-)  A simple script that lists the Pyrex code 
lines which lead to Python API calls would be sufficient.

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: khinsen at cea.fr
---------------------------------------------------------------------




More information about the Pyrex mailing list