[Cython] OpenMP support

Stefan Behnel stefan_ml at behnel.de
Sun Mar 13 16:44:59 CET 2011

Greg Ewing, 12.03.2011 23:57:
> 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.

Yes, absolutely. We may have come a lot closer now that Vitja is working on 
control flow analysis. That will allow us to see where variables need to 
get initialised and to decide what needs to be done when entering and 
leaving a "with gil" block. It may still not be trivial even with that, though.


More information about the cython-devel mailing list