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

Function OptionalParallelFor

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

Source from the content-addressed store, hash-verified

68
69template <class FUNCTION>
70Status OptionalParallelFor(bool use_threads, int num_tasks, FUNCTION&& func,
71 Executor* executor = internal::GetCpuThreadPool()) {
72 if (use_threads) {
73 return ParallelFor(num_tasks, std::forward<FUNCTION>(func), executor);
74 } else {
75 for (int i = 0; i < num_tasks; ++i) {
76 RETURN_NOT_OK(func(i));
77 }
78 return Status::OK();
79 }
80}
81
82// A parallelizer that takes a `Result<R>(int index, T item)` function and
83// calls it with each item from the input array, in sequence or in parallel,

Callers 6

WriteTableToBlocksMethod · 0.85
ConvertCategoricalsFunction · 0.85
CopyFilesFunction · 0.85
DecompressBuffersFunction · 0.85
CompressBodyBuffersMethod · 0.85
GetRecordBatchReaderMethod · 0.85

Calls 4

GetCpuThreadPoolFunction · 0.85
ParallelForFunction · 0.85
funcFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected