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/01/08 08:14:14 UTC

[GitHub] [arrow] michalursa opened a new pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

michalursa opened a new pull request #9134:
URL: https://github.com/apache/arrow/pull/9134


   FnOnce drops dependencies on invocation and is lighter weight than std::function


----------------------------------------------------------------
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



[GitHub] [arrow] michalursa commented on pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
michalursa commented on pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#issuecomment-756913220


   I'll address TaskGroup in [ARROW-11191](https://issues.apache.org/jira/browse/ARROW-11191)


----------------------------------------------------------------
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



[GitHub] [arrow] bkietz closed pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
bkietz closed pull request #9134:
URL: https://github.com/apache/arrow/pull/9134


   


----------------------------------------------------------------
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



[GitHub] [arrow] bkietz commented on a change in pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
bkietz commented on a change in pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#discussion_r554077313



##########
File path: cpp/src/arrow/util/thread_pool.cc
##########
@@ -84,10 +84,10 @@ static void WorkerLoop(std::shared_ptr<ThreadPool::State> state,
         break;
       }
       {
-        std::function<void()> task = std::move(state->pending_tasks_.front());
+        FnOnce<void()> task = std::move(state->pending_tasks_.front());
         state->pending_tasks_.pop_front();
         lock.unlock();
-        task();
+        std::move(task)();
       }

Review comment:
       since invoking task will drop its resources, we no longer need to wrap it in an explicit scope
   




----------------------------------------------------------------
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



[GitHub] [arrow] github-actions[bot] commented on pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#issuecomment-756677678


   https://issues.apache.org/jira/browse/ARROW-10966


----------------------------------------------------------------
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



[GitHub] [arrow] michalursa commented on pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
michalursa commented on pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#issuecomment-756913220


   I'll address TaskGroup in [ARROW-11191](https://issues.apache.org/jira/browse/ARROW-11191)


----------------------------------------------------------------
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



[GitHub] [arrow] github-actions[bot] commented on pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#issuecomment-756677678


   https://issues.apache.org/jira/browse/ARROW-10966


----------------------------------------------------------------
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



[GitHub] [arrow] bkietz commented on pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
bkietz commented on pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#issuecomment-756886802


   non apache CI: https://github.com/michalursa/arrow/runs/1667448683
   
   Rust failures are unrelated.


----------------------------------------------------------------
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



[GitHub] [arrow] bkietz commented on pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
bkietz commented on pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#issuecomment-756886802


   non apache CI: https://github.com/michalursa/arrow/runs/1667448683
   
   Rust failures are unrelated.


----------------------------------------------------------------
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



[GitHub] [arrow] bkietz closed pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
bkietz closed pull request #9134:
URL: https://github.com/apache/arrow/pull/9134


   


----------------------------------------------------------------
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



[GitHub] [arrow] bkietz commented on a change in pull request #9134: ARROW-10966: [C++] Use FnOnce for ThreadPool's tasks instead of std::function

Posted by GitBox <gi...@apache.org>.
bkietz commented on a change in pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#discussion_r554077313



##########
File path: cpp/src/arrow/util/thread_pool.cc
##########
@@ -84,10 +84,10 @@ static void WorkerLoop(std::shared_ptr<ThreadPool::State> state,
         break;
       }
       {
-        std::function<void()> task = std::move(state->pending_tasks_.front());
+        FnOnce<void()> task = std::move(state->pending_tasks_.front());
         state->pending_tasks_.pop_front();
         lock.unlock();
-        task();
+        std::move(task)();
       }

Review comment:
       since invoking task will drop its resources, we no longer need to wrap it in an explicit scope
   




----------------------------------------------------------------
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