-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
What changed for proxying between 2.0.8 and 2.0.23? #14312
Comments
It seems I can |
I think For examples, you can look in |
Hi @kripken , following Build FFmpeg WebAssembly version my compilation is using
vs.
The difference is that if I do not call the proxy ones, the execution seems to happen on main thread. Anything I am doing wrong? |
Normally one does not call See: Lines 118 to 138 in 087ca39
Because you are building with Lines 85 to 89 in 087ca39
|
Hi @sbc100 , These are my make instructions https://github.com/jozefchutka/ffmpeg.wasm-core/blob/yscene/wasm/build-scripts/build-ffmpeg.sh . After loading and calling I am still not sure how come it diverges from the suggested, do I need to explicitly expose callMain? I will try to expose it and see if it works. Should I expect any different behavior calling |
I think you need to add |
I have exported
...which differs from calling Any ideas? |
It seems it has to do something with how arguments are generated. The algorithm in callMain does
while the one from ffmpeg article
The latter seems more stable in my case. I am considering to stick with emsdk 2.0.8, which:
The 2.0.23 suffers from these 3 compared to 2.0.8 |
I'd recommend avoiding calling main multiple times, and instead export a function for that purpose, and call it as many times as you need. (The "dispose of workers when exit" issue seems separate, and may be worth filing a bug if you see an issue there?) |
Hi @kripken , I managed to export additional function
Can you please point me to the right direction or documentation in order to be able to call it multiple times via pthreads.
I have seen some realted activity on #14367 , thanks for that. I would love to see more docs or any solid instructions no how to proceed when main() (or any other) is to be called multiple times. |
It sounds like your codebase wants to actually run |
Although calling main mulitple times is technically not a good idea, I think in this case is probably OK. You could solve the both issues by modifying the code or using The important thing is the main all the static constructors and startup code in emscripten's |
You probably want to create you own wrapper that creates the thread just retuns. emscripten/system/lib/pthread/library_pthread.c Lines 935 to 951 in bdc97fe
Alternatively you could create your worker in JS and use postmessage to sent the work over to it.
The code in that comment looks reasonable assuming you need to pass strings. You can write simple wrapper that takes JS strings and converts them to an array of string. BTW, often times when building a library its easier to avoid the generic argv-style argument passing and use something more specific.
You can set |
Hi, in emsdk 2.0.8 my emcc args inlcuded:
followed by javascript:
however building with 2.0.23 it complains
emcc: error: undefined exported symbol: "_proxy_main" [-Wundefined] [-Werror]
I can remove the
_proxy_main
from the list, but then how to run main proxied?The text was updated successfully, but these errors were encountered: