Skip to content

Commit

Permalink
serial query generation since query generator is not thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
mority committed Apr 25, 2024
1 parent 3fbce6a commit a5c91d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions benchmark/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,12 @@ int main(int argc, char* argv[]) {
auto query_generation_timer = scoped_timer(fmt::format(
"generation of {} queries using seed {}", num_queries, qg.seed_));
std::cout << "Query generator settings:\n" << gs << "\n";
utl::parallel_for_run(num_queries, [&](auto const i) {
for (auto i = 0U; i != num_queries; ++i) {
auto const q = qg.random_pretrip_query();
if (q.has_value()) {
std::lock_guard<std::mutex> guard(mutex);
queries.emplace_back(q.value());
}
});
}
}

std::cout << queries.size() << " queries generated successfully\n";
Expand Down

0 comments on commit a5c91d6

Please sign in to comment.