zanmato1984 commented on issue #40069:
URL: https://github.com/apache/arrow/issues/40069#issuecomment-1964179005

   > > Right. The question here is that the scratch space is defined in a 
generic place, i.e., `ArraySpanFillFromScalarScratchSpace` (base class of all 
"scratched" scalars) and we couldn't know how it is going to be interpreted at 
runtime, despite whether all threads interpret it as the same type or not.
   > 
   > 
   > 
   > It would be incorrect for different threads to interpret it differently, 
even with a lock.
   
   You are right about this too.
   
   I think here are two things:
   1. Is the scratch being interpreted identically by different threads?
   2. If 1 is yes, is it a race?
   
   For 1, if the answer is no, then it should fall into some sort of undefined 
behavior area. That will be a user code problem that is using scalar the wrong 
way. It is not essential whether this is a race, or how the synchronization is 
implemented. And hopefully, and fortunately, I think current compute and Acero 
components are using scalar the "right way". So we don't really need to worry 
about it. 
   
   For 2, this is what we are really talking about. Aren't we :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to