-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Problems using std::future, std::launch::async #11959
Comments
We have no tests for |
Try setting |
Thanks for the suggestion but it did not help. Reading the documentation on |
I tried this test: #include <future>
#include <iostream>
int main() {
std::future<int> fut = std::async(std::launch::async, [] {
return 42;
});
std::cout << fut.get() << std::endl;
return 0;
} I compiled it with: emcc test.cpp -std=c++11 -s ASSERTIONS=0 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -o test.js (note that I've set And ran it with Node.js like this: node --experimental-wasm-threads -e "require('./test.js')" This prints the expected 42, although the runtime did not exits (I needed to hit Ctrl + C). Perhaps that's the problem? |
... If that's the problem, try setting (Pressed the comment button too early) |
Thanks, yes that was the problem. In fact, it didn't even need |
I think so. Doing |
Thanks for the help! |
I'm trying to get this simple test to work (on Node) and it seems to deadlock:
Is this supported at all? I'm compiling/linking with the following options:
The text was updated successfully, but these errors were encountered: