You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the latest merge of the pull request Initial support for pthreads with wasm#5710.
I was curious about thread support in webassembly and tried to compile the the following example cppreference storage duration , but compiling and executing with thread support only succeeded with asm as target.
Is thread support with the native webassembly backend currently limited or did I make a mistake?
Compiles and runs successfull when optimization is set to-01 or above (fails with -O0).
Program output:
Preallocating 1 workers for a pthread spawn pool.
Preallocating 1 workers for a pthread spawn pool.
Preallocating 1 workers for a pthread spawn pool.
Rage counter for main: 1
Rage counter for a: 2
Rage counter for b: 3
The missing piece here is the thread_local keyword, which is not yet supported in our multithreading work. This is on the TODO list though, since it's quite an important one. Thanks for the test case!
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.
After the latest merge of the pull request
Initial support for pthreads with wasm
#5710.I was curious about thread support in webassembly and tried to compile the the following example cppreference storage duration , but compiling and executing with thread support only succeeded with asm as target.
Is thread support with the native webassembly backend currently limited or did I make a mistake?
emsdk
sdk-incoming-64bit
compiled from source (emscripten-core/emsdk@d3a5609)emscripten/incoming (1754e32)
clang/fastcomp/src (emscripten-core/emscripten-fastcomp@7153769)
Firefox nightly Version 59.0a1
Example.cc:
Build from source for asm :
Compiles and runs successfull when optimization is set to-01 or above (fails with -O0).
Program output:
Build from source with asm2wasm backend:
Compiles but the program is not executable.
Build from source with native wasm backend:
LLVM ERROR: Cannot select: 0x55d8f3285d00: i32 = GlobalTLSAddress<i32* @rage> 0 In function: _ZTW4rage
It seems like an issue with the statement
thread_local unsigned int rage = 1;
The text was updated successfully, but these errors were encountered: