You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "joemarshall (via GitHub)" <gi...@apache.org> on 2023/06/07 05:53:56 UTC

[GitHub] [arrow] joemarshall commented on a diff in pull request #35672: GH-35176: [C++] Add support for disabling threading for emscripten

joemarshall commented on code in PR #35672:
URL: https://github.com/apache/arrow/pull/35672#discussion_r1220894872


##########
cpp/src/arrow/util/thread_pool.cc:
##########
@@ -532,6 +695,65 @@ int ThreadPool::DefaultCapacity() {
   return capacity;
 }
 
+#else  // ARROW_ENABLE_THREADING
+ThreadPool::ThreadPool() {

Review Comment:
   @kou I was going to do that initially, but the problem is that there is so much code that assumes that there is an IO pool and a cpu threadpool and that they are different things that it was easier just to keep track of them. And even code that uses serialexecutors assumes that other things will run concurrently because of the i/o pools. I found that rather than refactoring all code that uses thread pools, it was easier to make the threadpool & serialexecutors do some basic cooperative multitasking instead. This way also has an advantage in that it should be possible to incrementally patch in asynchronous features where the non-threading OS supports them, e.g. in emscripten it might use async calls to javascript for some types of i/o.



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org