You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jonkeane (via GitHub)" <gi...@apache.org> on 2026/05/20 12:31:16 UTC

Re: [PR] GH-49995: [R][Wasm] Fix threading issue under Wasm/Emscripten [arrow]

jonkeane commented on code in PR #49996:
URL: https://github.com/apache/arrow/pull/49996#discussion_r3273907715


##########
r/src/safe-call-into-r-impl.cpp:
##########
@@ -45,7 +45,16 @@ bool SetEnableSignalStopSource(bool enabled) {
 }
 
 // [[arrow::export]]
-bool CanRunWithCapturedR() { return MainRThread::GetInstance().Executor() == nullptr; }
+bool CanRunWithCapturedR() {
+#ifdef __EMSCRIPTEN__
+  // Threading is not supported under Emscripten/WASM. Always take the
+  // synchronous path to avoid attempting pthread_create which will fail
+  // with "thread constructor failed: Not supported".
+  return false;
+#else
+  return MainRThread::GetInstance().Executor() == nullptr;
+#endif

Review Comment:
   Is it possible to add a test (or maybe it's that we actually need to run the tests under wasm(???) to catch this?



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