Le 07/04/2020 à 18:49, Todd Lipcon a écrit :
>>
>> Hmm, the spec may not be clear enough on this, but if you move a child
>> and release the parent, then the other children are not usable anymore.
>>
>> In your case, you don't call release() on every child.  You just call
>> release() on the parent once you are done with all children.  So the
>> synchronization has to be managed on the consumer side, the producer
>> doesn't see any of it.
>>
> 
> I'm not sure I follow. If the consumer takes a top-level ArrowArray, and
> then moves out each of the children, then calls release() on the top-level
> array, the expectation is that the chlidren stay valid, according to the
> spec.

According to the spec, once you move a child, you are supposed to
release the parent ("immediately afterwards").  Then by construction you
cannot move other children.  I don't know if we want to make it possible
to move several children before releasing the parent.  Abstractly, that
may sound desirable, but we should check that doesn't impose further
constraints on the producer.

However, if as a consumer you're simply processing all children, then
there's no need to move them.  Just release the parent when you are
finished with all children.

Regards

Antoine.

Reply via email to