MCPcopy Create free account
hub / github.com/apache/arrow / MakeIOThreadPool

Function MakeIOThreadPool

cpp/src/arrow/io/interfaces.cc:427–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425constexpr int kDefaultNumIoThreads = 8;
426
427std::shared_ptr<ThreadPool> MakeIOThreadPool() {
428 int threads = kDefaultNumIoThreads;
429 auto maybe_num_threads = ::arrow::internal::GetEnvVarInteger(
430 "ARROW_IO_THREADS", /*min_value=*/1, /*max_value=*/std::numeric_limits<int>::max());
431 if (maybe_num_threads.ok()) {
432 threads = static_cast<int>(*maybe_num_threads);
433 } else if (!maybe_num_threads.status().IsKeyError()) {
434 maybe_num_threads.status().Warn();
435 }
436 auto maybe_pool = ThreadPool::MakeEternal(threads);
437 if (!maybe_pool.ok()) {
438 maybe_pool.status().Abort("Failed to create global IO thread pool");
439 }
440 return *std::move(maybe_pool);
441}
442
443} // namespace
444

Callers 1

GetIOThreadPoolFunction · 0.85

Calls 5

GetEnvVarIntegerFunction · 0.85
WarnMethod · 0.80
okMethod · 0.45
statusMethod · 0.45
AbortMethod · 0.45

Tested by

no test coverage detected