Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 41387df

Browse files
committed
deferred
1 parent eef423d commit 41387df

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

omniscidb/ResultSetRegistry/ColumnarResults.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <atomic>
2828
#include <future>
2929
#include <numeric>
30+
#include <ranges>
3031

3132
EXTERN extern bool g_is_test_env;
3233

@@ -672,7 +673,7 @@ void ColumnarResults::materializeAllLazyColumns(
672673
<< " work_count: " << worker_count << " num_cols: " << num_columns;
673674
for (auto interval : makeIntervals(first, last, worker_count)) {
674675
conversion_threads.push_back(std::async(
675-
std::launch::async,
676+
std::launch::deferred,
676677
[&do_work_just_lazy_columns, &targets_to_skip, first, this](const size_t start,
677678
const size_t end) {
678679
for (size_t i = start; i < end; ++i) {
@@ -684,8 +685,10 @@ void ColumnarResults::materializeAllLazyColumns(
684685
}
685686

686687
try {
687-
for (auto& child : conversion_threads) {
688-
child.wait();
688+
for (auto it_child = conversion_threads.rbegin();
689+
it_child != conversion_threads.rend();
690+
++it_child) {
691+
it_child->wait();
689692
}
690693
} catch (...) {
691694
throw;

0 commit comments

Comments
 (0)