[ 
https://issues.apache.org/jira/browse/ARROW-2052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16345794#comment-16345794
 ] 

ASF GitHub Bot commented on ARROW-2052:
---------------------------------------

wesm commented on issue #1534: ARROW-2052: [C++ / Python] Rework OwnedRef, 
remove ScopedRef
URL: https://github.com/apache/arrow/pull/1534#issuecomment-361731025
 
 
   I need to take a closer look at our various usages of `OwnedRef` -- there 
are places where we have `OwnedRef` as member variables of classes, so the risk 
is that an OwnedRef might be destructed at the same time that a `PyAcquireGIL` 
lock is being destructed, so we could be relying on the order of destruction to 
make sure the GIL is held. We'll need to prevent this by making sure that no 
OwnedRef can be destructed at the same time as a GIL is released by RAII

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Unify OwnedRef and ScopedRef
> ----------------------------
>
>                 Key: ARROW-2052
>                 URL: https://issues.apache.org/jira/browse/ARROW-2052
>             Project: Apache Arrow
>          Issue Type: Task
>          Components: Python
>    Affects Versions: 0.8.0
>            Reporter: Antoine Pitrou
>            Assignee: Antoine Pitrou
>            Priority: Trivial
>              Labels: pull-request-available
>
> Currently {{OwnedRef}} and {{ScopedRef}} have similar semantics with small 
> differences. Furtheremore, the naming distinction isn't obvious.
> I propose to unify them as a single {{OwnedRef}} class with the following 
> characteristics:
> - doesn't take the GIL automatically
> - has a {{release()}} method that decrefs the pointer (and sets the internal 
> copy to NULL) before returning it
> - has a {{detach()}} method that returns the pointer (and sets the internal 
> copy to NULL) without decrefing it
> For the rare situations where an {{OwnedRef}} may be destroyed with the GIL 
> released, a {{OwnedRefNoGIL}} derived class would also be proposed (the 
> naming scheme follows Cython here).
> Opinions / comments?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to