srilman commented on code in PR #43698:
URL: https://github.com/apache/arrow/pull/43698#discussion_r1915237733
##########
cpp/src/arrow/util/thread_pool.h:
##########
@@ -605,15 +620,7 @@ typename Fut::SyncType
RunSynchronously(FnOnce<Fut(Executor*)> get_future,
template <typename T>
Iterator<T> IterateSynchronously(
FnOnce<Result<std::function<Future<T>()>>(Executor*)> get_gen, bool
use_threads) {
- if (use_threads) {
- auto maybe_gen = std::move(get_gen)(GetCpuThreadPool());
- if (!maybe_gen.ok()) {
- return MakeErrorIterator<T>(maybe_gen.status());
- }
- return MakeGeneratorIterator(*maybe_gen);
- } else {
- return SerialExecutor::IterateGenerator(std::move(get_gen));
- }
+ return IterateSynchronously(std::move(get_gen), use_threads,
GetCpuThreadPool());
Review Comment:
Good point. I modified the API to accept nulls and if it is null, we use the
default CPU thread pool, but only in `use_threads == true` case
--
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]