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

Function ParallelFor

cpp/src/arrow/util/parallel.h:35–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34template <class FUNCTION>
35Status ParallelFor(int num_tasks, FUNCTION&& func,
36 Executor* executor = internal::GetCpuThreadPool()) {
37 std::vector<Future<>> futures(num_tasks);
38
39 for (int i = 0; i < num_tasks; ++i) {
40 ARROW_ASSIGN_OR_RAISE(futures[i], executor->Submit(func, i));
41 }
42 auto st = Status::OK();
43 for (auto& fut : futures) {
44 st &= fut.status();
45 }
46 return st;
47}
48
49template <class FUNCTION, typename T,
50 typename R = typename internal::call_traits::return_type<FUNCTION>::ValueType>

Callers 3

TESTFunction · 0.85
OptionalParallelForFunction · 0.85
WriteRecordBatchMethod · 0.85

Calls 4

GetCpuThreadPoolFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
statusMethod · 0.45

Tested by 1

TESTFunction · 0.68