mapleFU commented on code in PR #43698:
URL: https://github.com/apache/arrow/pull/43698#discussion_r1900916942
##########
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:
This implicitly introducing a behavior change, previously if `!use_threads`,
`GetCpuThreadPool()` would be nevercall, and maybe the global cpu pool would
not being initialized. However, seems here it would be initialized?
##########
cpp/src/arrow/util/thread_pool.h:
##########
@@ -591,6 +591,21 @@ typename Fut::SyncType
RunSynchronously(FnOnce<Fut(Executor*)> get_future,
}
}
+template <typename T>
Review Comment:
Comment for this?
--
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]