Skip to content
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

How to do multi-threading with emscripten? #1

Open
aarlt opened this issue Mar 18, 2023 · 0 comments
Open

How to do multi-threading with emscripten? #1

aarlt opened this issue Mar 18, 2023 · 0 comments

Comments

@aarlt
Copy link
Owner

aarlt commented Mar 18, 2023

I just leave a question here, so maybe somebody knows the answer and can give me some feedback 😅

How can I enable multi-threading in emscripten? I did some superficial research on that, but I was not successful. So far I did not had the time to dig deeper in that.

However, I tried already different things described here:

  • linking with pthread (that is already done in this example)
  • defining a thread pool-size with -sPTHREAD_POOL_SIZE
  • compiling with -sPROXY_TO_PTHREAD

But in all cases the application get terminated with an exception while starting the thread. My understanding is that emscripten is now supporting posix threads, because there is now shared memory support in browsers. This example tries to start a thread when a button is pressed. The button is located inside the "Hello, world!" window, where a click on the button "Button" tries to create a new thread.

I mean for simple applications that is probably sufficient, but to have real threading support here would be really just awesome. However, I was not able to make this work. Any help will be very appreciated 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant