[Pyrex] Callbacks from threads and PyGILState_Ensure/PyGILState_Release

Ulisses Furquim ulisses.silva at openbossa.org
Wed Aug 15 22:42:27 CEST 2007


Hi Stefan,

On 8/15/07, Stefan Behnel <stefan_ml at behnel.de> wrote:
> ... interesting stuff should go into Cython as well ...
>
> Thanks for the patch, lxml needs this functionality in a couple of places, so
> it would be nice to have Cython support for this.

We can make a patch for Cython once we settle how this is gonna be for
Pyrex. Is that ok for you?

> It's not a completely generic solution, though, as there are still a couple of
> places where you'd want to check a few things /before/ acquiring the GIL.
> Those would still require an additional wrapper function.
>
> Maybe we could have a more funny construct like
>
>   with __GIL:
>       ....
>
> that would let Pyrex/Cython consider the GIL not to be set around that block?
> But that feels like too much magic to me already...

Yeah, it looks too much magic for me but if we do have some use cases
for this it may be worth implementing.

Regards,

-- Ulisses



More information about the Pyrex mailing list