felipecrv opened a new pull request, #40647:
URL: https://github.com/apache/arrow/pull/40647

   ### Rationale for this change
   
   Using Acquire-Release ordering [1] for operations on `MemoryStats` atomics 
so they don't add so much overhead on all memory allocations and deallocations 
in workloads using memory-pools from multiple threads.
   
   [1] 
https://en.cppreference.com/w/cpp/atomic/memory_order#Release-Acquire_ordering
   
   ### What changes are included in this PR?
   
    - Make all the read-modify-write operations use `memory_order_acq_rel`
    - Make all the loads use `memory_order_acquire` (meaning that the loads can 
see all the stores performed before by this or other threads)
    - Make all the stores use `memory_order_release` (to pair with the loads 
using `acquire`) 
   
   ### Are these changes tested?
   
   By existing tests and careful reasoning about atomic semantics explained in 
comments.


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