-
Notifications
You must be signed in to change notification settings - Fork 80
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
Emscripten support #134
Comments
So, I did a bit of playing around with emscriptem. It could be possible to implement the However, the biggest issue is lack of threads support: https://emscripten.org/docs/porting/pthreads.html
If I remove the joins, the prints all work. If I leave them in, the browser hangs trying to compile the WASM to native. So, it could be possible in future for FTL to compile to WASM via Emscripten. But, atm, it's blocked by the lack of full threads support. |
I tried you code and it works on my end. Did you compile it with |
Ah. I didn't try |
Thank you for looking into this. Per the emscripten Pthreads page that you linked, for testing Firefox won't work unless your web server explicitly write header responses related to COOP and COEP Cross-Origin Policies. Chrome should be fine I think. |
I got it to compile, but when I try to run the triangle_num example in Chrome, it throws an exception: https://github.com/RichieSams/FiberTaskingLib/tree/add_wasm_support Any ideas? I'm passing But my brief searching through the project source code, I wasn't able to find any reference to compiler / linker args. |
Hmm. I was able to run https://github.com/emscripten-core/emscripten/blob/4d864df0a57024d667e8db171aab2c3385d04c30/tests/test_fibers.cpp With
|
Ah ha! It looks like I need
When compiling the example / tests as well. Not just the lib. It now fails with some malloc size exceptions. But debugging for another day. Time for bed for me. |
Tested Yes you need to use the flags for compiling AND linking. I passed it to |
Hi,
Thank you for this awesome library. Is it possible to have emscripten support using its fiber library https://emscripten.org/docs/api_reference/fiber.h.html ?
The text was updated successfully, but these errors were encountered: