You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/06/09 17:44:46 UTC

[GitHub] [arrow] westonpace commented on a change in pull request #10401: ARROW-12878: [C++] Generalize thread pool to allow for different queuing strategies / worker loops

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



##########
File path: cpp/src/arrow/util/future_test.cc
##########
@@ -106,12 +107,18 @@ template <typename T>
 class SimpleExecutor {
  public:
   explicit SimpleExecutor(int nfutures)
-      : pool_(ThreadPool::Make(/*threads=*/4).ValueOrDie()) {
+      : pool_(SimpleThreadPool::Make(/*threads=*/4).ValueOrDie()) {
     for (int i = 0; i < nfutures; ++i) {
       futures_.push_back(Future<T>::Make());
     }
   }
 
+  // Need to explicilty call the pool shutdown.  The worker threads have a shared_ptr
+  // to the pool so they will keep it alive after this class is destructed.  However, the

Review comment:
       It is the latter.  The test spawns a task and gives it a reference (via `this` capture) to a future.  The future is destroyed when the test is destroyed which was happening before the spawned task was finished.




-- 
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:
users@infra.apache.org