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
{{ message }}
Repository navigation
Add support for simultaneously using dynamic linking + pthreads. #3494
This issue has been automatically marked as stale because there has been no activity in the past 2 years. 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.
I don't believe anyone is working on it. It would require some design thinking, as say dlopen on one thread would require adding to the Table on all other threads. However, non-dlopen dynamic linking may be a lot easier.
@sbc100 talked about a shared table instead, would it be feasible? the SIDE_MODULE would still expose its native table to JS (like a normal wasm module does). I don't see how emscripten reads the native table? is it here?
For now, "agressively" disabling the errors when we USE_PTHREADS+SIDE_MODULE lands into a wasm-ld assert:
Current there is no concept of a shared wasm table in the spec, so each thread necessarily has its own table. And the tables need to stay in sync because C/C++ code expects to be able the share function pointer between threads.
Right now we really on the startup code on each thread insantiating the wasm module and the local table such that local table on each thread ends up with the same content.
Each time you load a DLL new table entries get add, so these table entries (and the DLL itself) need to propagated to each thread). If it can be done deterministicly then as perhaps just loading the DLL on each thread would be enough to guarantee the same table contents?
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 30 days. Feel free to re-open at any time if this issue is still relevant.
I think this is is largely complete. We still warn about it being experimental, but it should work % bugs. We can open specific bugs if/when they are found.
Activity
kripken commentedon Jun 3, 2015
I would hope that this would just work. Did you see a problem when trying it?
juj commentedon Jun 3, 2015
I did not try, this was motivated by your comment in the pull, will need a bit of an audit and testing.
stale commentedon Aug 31, 2019
This issue has been automatically marked as stale because there has been no activity in the past 2 years. 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.
jbkempf commentedon Dec 17, 2019
Any update on this?
kripken commentedon Dec 17, 2019
I don't believe anyone is working on it. It would require some design thinking, as say dlopen on one thread would require adding to the Table on all other threads. However, non-dlopen dynamic linking may be a lot easier.
jbkempf commentedon Dec 17, 2019
What about dlopening all from the "main-thread"?
jbkempf commentedon Dec 17, 2019
That would mean to have all the .so (is it really .so?) modules loaded all the time, no?
msabwat commentedon Dec 17, 2019
@sbc100 talked about a shared table instead, would it be feasible? the SIDE_MODULE would still expose its native table to JS (like a normal wasm module does). I don't see how emscripten reads the native table? is it here?
For now, "agressively" disabling the errors when we USE_PTHREADS+SIDE_MODULE lands into a wasm-ld assert:
Makes me think there's another write. Is it like that? :
Dynamic linking in our case would be to be able to feed the JS table from SIDE_MODULES and read from it from the MAIN_MODULE.
sbc100 commentedon Dec 17, 2019
Current there is no concept of a shared wasm table in the spec, so each thread necessarily has its own table. And the tables need to stay in sync because C/C++ code expects to be able the share function pointer between threads.
Right now we really on the startup code on each thread insantiating the wasm module and the local table such that local table on each thread ends up with the same content.
Each time you load a DLL new table entries get add, so these table entries (and the DLL itself) need to propagated to each thread). If it can be done deterministicly then as perhaps just loading the DLL on each thread would be enough to guarantee the same table contents?
20 remaining items
pthread+dylink: Ensure code is in sync on thread start
pthread+dylink: Ensure code is in sync on thread start (#16195)
stale commentedon Apr 17, 2022
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 30 days. Feel free to re-open at any time if this issue is still relevant.
akien-mga commentedon Apr 26, 2022
I don't think this should be closed as wontfix, it's a major issue.
sbc100 commentedon Apr 26, 2022
I think this is is largely complete. We still warn about it being experimental, but it should work % bugs. We can open specific bugs if/when they are found.
Cleanup tests/core/pthread/create. NFC.
Cleanup test/core/pthread/create. NFC.
Cleanup test/core/pthread/create. NFC. (#12756)
Convert more core tests from C++ to C. NFC
Convert more core tests from C++ to C. NFC
[lld][WebAssembly] Fix malformed output with -pie + --shared-memory
[lld][WebAssembly] Set memory limits correctly for PIC + shared memory