colin-r-schultz opened a new pull request, #45372:
URL: https://github.com/apache/arrow/pull/45372

   ### Rationale for this change
   
   GH-45371
   
   ### What changes are included in this PR?
   
   Use `std::atomic_compare_exchange` to initialize `boxed_columns_[i]` so they 
are correctly written only once. This means that a reference to 
`boxed_columns_` is safe to read after each element has been initialized.
   
   ### Are these changes tested?
   
   Yes, there is a test case `TestRecordBatch.ColumnsThreadSafety` which passes 
under TSAN.
   
   ### Are there any user-facing changes?
   
   No
   
   **This PR contains a "Critical Fix".**
   
   Without this fix, concurrent calls to `SimpleRecordBatch::columns` could 
lead to an invalid memory access and crash.


-- 
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