Commits


Weston Pace authored and Antoine Pitrou committed e7b6c4ac711
ARROW-12560: [C++] Add scheduling option for Future callbacks Previously a future's callbacks would always run synchronously, either as part of `Future::MarkFinished` or as part of `Future::AddCallback`. `Executor::Transfer` made it possible to schedule continuations on a new thread but it would only take effect if the transferred future's callbacks were added before the source future finished. There are times when the desired behavior is to spawn a new thread task even if the source future is finished already. This PR adds three scheduling options: * Never - The default (and existing) behavior, never spawn a new task * IfUnfinished - Spawn a new task only if the future isn't already finished when the callback is added * Always - Always spawn a new task, on both finished and unfinished futures, regardless of destination thread pool idleness. The `Never` option doesn't make any sense for transferring so the transfer only has two choices (always or if unfinished). Closes #10258 from westonpace/feature/ARROW-12560--c-investigate-utilizing-aggressive-thread-task Lead-authored-by: Weston Pace <weston.pace@gmail.com> Co-authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>