| 425 | constexpr int kDefaultNumIoThreads = 8; |
| 426 | |
| 427 | std::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 |
no test coverage detected