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
which gets called from various pthread primitives that the runtime calls, such as pthread_join or pthread_cond_timedwait.
We should try setting -s ALLOW_BLOCKING_ON_MAIN_THREAD=false and investigate whether the blocking operations are really necessary. If fixing the blocking is infeasible, we should consider overriding Module.PThread.emscripten_check_blocking_allowed to not nag.
changed the title [-][wasm-mt] papercut: Emscripten warns about blocking on the main thread even if user code doesn't[/-][+][browser][mt] Emscripten warns about blocking on the main thread even if user code doesn't[/+]on Nov 9, 2023
changed the title [-][browser][mt] Emscripten warns about blocking on the main thread even if user code doesn't[/-][+][browser][mt] Upgrade emscripten[/+]on Jan 26, 2024
I think the message could be supressed in newer versions of emscripten.
Do you mean "The log message that emcc will sometime print (for example when auto-building system libraries) can now be completely suppressed by running with EMCC_LOGGING=0" changelog?
It seems that the situation changed a lot. We have a possibility of config with jsThreadBlockingMode: "WarnWhenBlockingWait" that produces only our own warning from
varst=$"Blocking the thread with JS interop is dangerous and could lead to deadlock. ManagedThreadId: {Environment.CurrentManagedThreadId}\n{Environment.StackTrace}";
.
Even with jsThreadBlockingMode: "DangerousAllowBlockingWait I cannot observe messages from emscripten logged when block-waiting.
Adding <EmscriptenEnvVars Include="EMCC_LOGGING=0" /> would not change anything. I think we could close it.
Reproducing blocking during GC's stop-the-world does not sound like an easy thing. Do you have ideas how to force it? I was planning to check if the logs are there, then add that flag and possibly close the thread.
We can close this one (about emscripten bump).
The remaining issue will be solved by not blocking UI thread #100411 I updated it to also mention the message
Activity
pavelsavara commentedon Jun 20, 2023
This is how mono thread pool joins threads in order to finalize them.
Other significant use is
mono_os_mutex_lockwhich is used in about 40 placesI think that we are unlikely to be able to remove it.
Alternate strategy could be to run mono always on the worker.
[-][wasm-mt] papercut: Emscripten warns about blocking on the main thread even if user code doesn't[/-][+][browser][mt] Emscripten warns about blocking on the main thread even if user code doesn't[/+]pavelsavara commentedon Jan 26, 2024
I think the message could be supressed in newer versions of emscripten.
Should we bump version of emscripten ?
Should we also switch to using https://github.com/dotnet/emscripten/ in our inner loop ?
@radekdoulik @lewing
[-][browser][mt] Emscripten warns about blocking on the main thread even if user code doesn't[/-][+][browser][mt] Upgrade emscripten[/+]ilonatommy commentedon Jul 25, 2024
Do you mean "The log message that emcc will sometime print (for example when auto-building system libraries) can now be completely suppressed by running with EMCC_LOGGING=0" changelog?
ilonatommy commentedon Jul 25, 2024
It seems that the situation changed a lot. We have a possibility of config with
jsThreadBlockingMode: "WarnWhenBlockingWait"that produces only our own warning fromruntime/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs
Line 745 in 72c9b85
Even with
jsThreadBlockingMode: "DangerousAllowBlockingWaitI cannot observe messages from emscripten logged when block-waiting.Adding
<EmscriptenEnvVars Include="EMCC_LOGGING=0" />would not change anything. I think we could close it.pavelsavara commentedon Jul 29, 2024
We are not running C# code on UI thread anymore and so the user code would not be blocking.
It could still happen because we stop-the-world during GC.
jsThreadBlockingModeis about something slightly different.pavelsavara commentedon Jul 29, 2024
Latest
https://github.com/emscripten-core/emscripten/blob/8c81cac1bbae378bc7dde0c21c99602cbaf452d0/src/library_pthread.js#L910-L922
ilonatommy commentedon Jul 29, 2024
Reproducing blocking during GC's stop-the-world does not sound like an easy thing. Do you have ideas how to force it? I was planning to check if the logs are there, then add that flag and possibly close the thread.
pavelsavara commentedon Jul 29, 2024
We can close this one (about emscripten bump).
The remaining issue will be solved by not blocking UI thread #100411 I updated it to also mention the message