[Cython] OpenMP support

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Mar 12 23:57:58 CET 2011

mark florisson wrote:

> Have we ever thought about supporting 'with gil' as an actual
> statement instead of just as part of a function declaration or
> definition?

That's the way I was originally going to do it in Pyrex, but
it turned out to be problematic, because there is some setup
that gets done on entering a function -- increfing parameters,
initialising locals to None, etc. -- that is needed in order
to support Python operations being done anywhere in the function.

Allowing for a 'with gil' block would require deferring those
things until entering the block, and making sure nothing is done
outside the block that relies on them. Probably not impossible,
but it would require some extensive rearrangements.


More information about the cython-devel mailing list