-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Pthreads keeps increasing with WASM #11825
Comments
One way to investigate this could be to look for |
Thanks for the guidance. In my native code there are threads getting created using |
Does calling If so then it's either a bug in |
I did try to call Also looking at the worker.js code comment below, the exit operation is started even if there is no explicit call to
|
Interesting. Not sure what's going on then. Note that Workers are not deleted immediately - only the next time the browser does a GC. So seeing a long list of workers may not be a bug. But seeing new workers created unnecessarily would indicate that emscripten is not reusing them, which would be a bug. |
Could you please guide me how should I proceed from here? Can I do something from my side to help? Or do I have to wait for the bug to be created and fixed? |
I think the main options are for you to continue to debug it on your side (did my last comments not help?), or otherwise to create a small testcase you can share with us (without a testcase, there isn't enough information to investigate this). |
On further debugging the generated .js code, I found that the the created thread when detached are not added back to JS code before: No handling for exit command
Modified code: Cleanup on exit command
I am not sure if this is the right change, but it seems workers not getting added to |
Hi,
I am new to webassembly. I am porting some cross platform code to WebAssembly with WASM=0, USE_PTHREADS=1 and PTHREAD_POOL_SIZE=8.
While running the code in chrome as browser extension, I observe that in chrome task manager the number of dedicated worker keeps increasing and my extension crashes after consuming good amount of memory. It seems all are detach pthreads. Is there a way to investigate what is going wrong.
I am using sdk-fastcomp-tag-1.38.30-64bit version of emsdk.
The text was updated successfully, but these errors were encountered: