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
We currently do runtime dynamic linking (dlopen) in our app which is single-threaded. For dlopen to work, we have used FS.createLazyFile for all the side modules in Module.preInit. When dlopen is called side-modules are downloaded and used. Now, we are trying to enable pthreads in our app. When dlopen is called on a thread other than main application thread (on which we have mounted the side modules), FS is unable to find these mounted side modules and hence our whole logic fails. Does FS even work with pthreads? Or is there any alternate way of using dlopen with pthreads?
The text was updated successfully, but these errors were encountered:
The FS object only exists (or rather is only usable) on the main thread.
However, all filesystem operations in C/C++ are proxied back to the main thread. In particular with dlopen the operation is always proxied back to the main thread. So we have several test for dlopen on multiple threads so we know it works in the general case and there should no no FS operations that occur on the side module.
Can you try with the latest version of emscripten (3.1.35 is a year old now)? It could be that some of the fixes needed for side modules and threading happened in more recent versions.
Please include the following in your bug report:
Version of emscripten/emsdk:
We currently do runtime dynamic linking (
dlopen
) in our app which is single-threaded. Fordlopen
to work, we have usedFS.createLazyFile
for all the side modules inModule.preInit
. Whendlopen
is called side-modules are downloaded and used. Now, we are trying to enable pthreads in our app. Whendlopen
is called on a thread other than main application thread (on which we have mounted the side modules),FS
is unable to find these mounted side modules and hence our whole logic fails. DoesFS
even work with pthreads? Or is there any alternate way of usingdlopen
with pthreads?The text was updated successfully, but these errors were encountered: