[Numpy-discussion] Do getitem/setitem already have GIL?

Sebastian Berg sebastian at sipsolutions.net
Thu Apr 21 03:02:17 EDT 2016

This is for a custom dtype? getitem and setitem work with objects and
must have the GIL in any case, so yes, you can safely assume this. I
think you probably have to set the flags correctly for some things to
work right. So that the PyDataType_REFCHK makro gives the right result.
Though frankly, I am just poking at it here, could be all wrong.

- Sebastian

On Mi, 2016-04-20 at 19:22 +0000, Steve Mitchell wrote:
> When writing custom PyArray_ArrFuncs getitem() and setitem(), do I
> need to acquire the GIL, or has it been done for me already by the
> caller?
>   --Steve
> http://docs.scipy.org/doc/numpy/reference/c-api.array.html?highlight=
> allow_c_api#group-2
> http://docs.scipy.org/doc/numpy/reference/internals.code-explanations
> .html?highlight=gil#function-call
> http://docs.scipy.org/doc/numpy/reference/c-api.types-and-structures.
> html
> https://docs.python.org/2/c-api/init.html#thread-state-and-the-global
> -interpreter-lock
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160421/c23621f0/attachment.sig>

More information about the NumPy-Discussion mailing list