-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-35176: [C++] Add support for disabling threading for emscripten #35471
Conversation
This is useful for emscripten, where a lot of the time one doesn't have any threads. Could also be useful for any embedded ports etc.
Hmm, I've started reviewing this PR but it adds a lot of code in various delicate internals (Future, ThreadPool, TaskGroup...) that makes me uneasy. Do we value emscripten/webassembly compat so much that it warrants the cost in maintainability? Would there be another way to support emscripten/webassembly? |
removed debug file
I think I've done the current review comments - so as i understand it I can run the test from tasks.yml by commenting in here like this? @github-actions crossbow submit test-ubuntu-22.04-cpp-no-threading |
@github-actions crossbow submit test-ubuntu-22.04-cpp-no-threading |
|
@github-actions crossbow submit test-ubuntu-22.04-cpp-no-threading |
|
@joemarshall Could you create a feature branch for this instead of using the |
@kou A feature branch in my repo? Or does someone need to make a feature branch in the main repo which I can target the pull request against? |
Yes. |
This is now in #35672 which is the same but from a differently named branch because that means that the CI stuff (crossbow submit commands) actually work, whereas they don't work if the name of the source branch is main. |
As previously discussed in #35176 this is a patch that adds an option
ARROW_DISABLE_THREADING
. When it is turned on, arrow threadpool and serial executors don't spawn threads, and instead run tasks in the main thread when futures are waited for.It doesn't mess with threading in projects included as dependencies, e.g. multithreaded malloc implementations because if you're building for a non threaded environment, you can't use those anyway.
Basically where this is at is that it runs the test suite okay, and I think should work well enough to be a backend for pandas on emscripten/pyodide, so subject to reviews etc. it is worth merging (and would be jolly convenient for me if it was).
What this means is:
Things that don't work and probably won't:
Things that don't work yet and could be fixed in future: