-
Notifications
You must be signed in to change notification settings - Fork 10.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 will happen if C# p/invokes a C++ WASM module that starts a WebWorker and then calls back to C# callback? #42851
Comments
@devshgraphicsprogramming thanks for contacting us. This is a dupe of #17730 |
I didn't get answers to any of my questions. |
Nowadays .NET runs in either Webassembly or native with blazor projects (E.G Blazor Webassembly vs Maui.Blazor) The awesome firefox cartoon girl I am more confident that it would work if .NET is running without Webassembly, I have never tried it though |
How do you mean native when MAUI Blazor just uses Javascript?
There was a native Blazor project called Blazor Mobile Bindings which was scrapped. That project focused on binding native (platform specific) controls to Blazor syntax. |
Dotnet rt doesn't run inside Maui.Blazor's webview I found out, all your c# code is running with regular multi-threading scenario's support, when you update the virtual dom it talks to the webview and the webview updates the UI. There is no way they just let dotnet run inside the browser via javascript anymore, it used to be ASM.js, then webassembly was a better choice for any compiled code |
Blazor Mobile binding was an experimental project that let you write Xamarin app with blazor syntax which I love, because it's very painful for me to write Xaml app due to these products always assume there is a pattern you are following and really made it hard for me to do my own stuffs. Blazor hybrid was the step further, since Today's Maui.blazor is basically a re-branded name with a lot effort put into the project (before release bugs were issued and sometimes it's severe and it was resolved in preview). Blazor Desktop was before MAUI, they made the guy's project offifical, before it was experimental. |
Summary
Since
SharedByteArray
is again available on browsers (provided you do all the CORS header stuff properly as required by site isolation), this renders the following comment #16954 (comment) obsolete.Also AFAIK, WebWorker post-message (exposed as a C API in emscripten) does not need SBA to work, but yes, without SBA attempting to work on the same memory will straight up not work.
Anyway, realizing that Blazor wont catch up on SBA availability immediately, I've had an idea (assuming #56145 doesn't prevent me) to use a small C++ lib to facilitate launching or additional threads or web workers executing C# code.
Now the question is, will that break the runtime?
Motivation and goals
Achieve threading or parallelism while still running C# and not C++
In scope
new
ing C# objects in multiple threads which won't share objectsOut of scope
Risks / unknowns
Bonus Round
Is it possible to make the Blazor runtime back its GC arena/memory-pool with
WebAssembly.Memory(,,shared:true)
?Related
#14253
The text was updated successfully, but these errors were encountered: