Skip to content

Commit

Permalink
Do priorities in the right order, I think. Also set lower priority
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Newton committed Nov 28, 2024
1 parent 823125c commit ff983b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cpp/src/arrow/util/parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ Future<std::vector<R>> ParallelForAsync(
std::vector<T> inputs, FUNCTION&& func,
Executor* executor = internal::GetCpuThreadPool()) {
std::vector<Future<R>> futures(inputs.size());
TaskHints hints;
hints.priority = 10;
for (size_t i = 0; i < inputs.size(); ++i) {
ARROW_ASSIGN_OR_RAISE(futures[i], executor->Submit(func, i, std::move(inputs[i])));
ARROW_ASSIGN_OR_RAISE(futures[i], executor->Submit(hints, func, i, std::move(inputs[i])));
}
return All(std::move(futures))
.Then([](const std::vector<Result<R>>& results) -> Result<std::vector<R>> {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/util/thread_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct QueuedTask {
Task task;
TaskHints hints;
bool operator<(const QueuedTask& other) const {
return hints.priority < other.hints.priority;
return hints.priority > other.hints.priority;
}
};

Expand Down

0 comments on commit ff983b1

Please sign in to comment.