westonpace commented on a change in pull request #7179:
URL: https://github.com/apache/arrow/pull/7179#discussion_r543006149



##########
File path: cpp/src/arrow/util/thread_pool.h
##########
@@ -218,7 +220,8 @@ class ARROW_EXPORT ThreadPool : public Executor {
 
   ThreadPool();
 
-  Status SpawnReal(TaskHints hints, std::function<void()> task) override;
+  Status SpawnReal(TaskHints hints, std::function<void()> task,
+                   StopToken* = NULLPTR) override;

Review comment:
       Why expose the stop token to the executor at all?  If I'm writing a 
custom executor what do I do with the stop token?  I see that the thread pool 
uses this to skip the task if it has been cancelled prior to scheduling but 
conceivably this could be achieved by wrapping the task as well in the same way 
that the TaskGroup::AppendReal does.  Do you envision certain classes of custom 
executor will want to do something different with the stop token?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to