marin-ma commented on code in PR #12370:
URL: https://github.com/apache/gluten/pull/12370#discussion_r3527815770


##########
cpp/velox/compute/VeloxBackend.cc:
##########
@@ -301,6 +301,18 @@ facebook::velox::cache::AsyncDataCache* 
VeloxBackend::getAsyncDataCache() const
   return asyncDataCache_.get();
 }
 
+ReaderThreadPool* VeloxBackend::getReaderThreadPool() {
+  static std::once_flag readerThreadPoolInit;
+  std::call_once(readerThreadPoolInit, [this] {
+    const auto configuredThreads =
+        backendConf_->get<int32_t>(kShuffleReaderThreads, 
static_cast<int32_t>(std::thread::hardware_concurrency()));
+    // std::thread::hardware_concurrency() can return 0;
+    const auto numThreads = configuredThreads > 0 ? configuredThreads : 1;
+    readerThreadPool_ = std::make_unique<ReaderThreadPool>(numThreads);
+  });
+  return readerThreadPool_.get();
+}

Review Comment:
   VeloxBackend::create() only called once.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to