pitrou commented on a change in pull request #12358:
URL: https://github.com/apache/arrow/pull/12358#discussion_r801409555



##########
File path: cpp/src/arrow/util/thread_pool.h
##########
@@ -373,7 +377,7 @@ class ARROW_EXPORT ThreadPool : public Executor {
   State* state_;
   bool shutdown_on_destroy_;
 #ifndef _WIN32
-  pid_t pid_;
+  std::atomic<pid_t> pid_;

Review comment:
       Yes, an atomic is required at least for theoretical correctness and to 
avoid (potentially) tripping up TSAN.
   The compiler and/or the CPU is otherwise theoretically allowed to issue the 
integer read as multiple distinct reads (say, issue a 32-bit read as two 16-bit 
reads; I suppose that never happens in practice :-)




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