dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.91k stars 4.64k forks source link

[browser][MT] make UI thread not managed/attached #100411

Open pavelsavara opened 5 months ago

pavelsavara commented 5 months ago

Currently the UI thread is attached Mono thread and can call into Managed code. The downside is that it needs to enter GC barrier, which makes it participate in the stop-the-world.

Current blockers are

Also emscripten will complain about blocking UI thread when ASSERTIONS are enabled. Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread

See https://github.com/emscripten-core/emscripten/blob/8c81cac1bbae378bc7dde0c21c99602cbaf452d0/src/library_pthread.js#L910-L922

If we are unable to do this, the alternative is https://github.com/dotnet/runtime/issues/76963

dotnet-policy-service[bot] commented 5 months ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.