Skip to content
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

.NET WebAssembly support of task based parallelism. #40619

Open
RChrisCoble opened this issue Aug 8, 2020 · 11 comments
Open

.NET WebAssembly support of task based parallelism. #40619

RChrisCoble opened this issue Aug 8, 2020 · 11 comments
Milestone

Comments

@RChrisCoble
Copy link

Is it in the roadmap for Blazor to support .Net's task based parallelism with WASM threads in .Net 5 or 6?

For instance, Chrome released WASM threads support in version 70. (I'm running version 84), so it's been out for some time. I'm not looking for async/await, I'm looking for maximizing the core usage through Task().

@pranavkm pranavkm transferred this issue from dotnet/aspnetcore Aug 10, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Aug 10, 2020
@pranavkm pranavkm changed the title Blazor support of task based parallelism. .NET WebAssembly support of task based parallelism. Aug 10, 2020
@pranavkm pranavkm added the arch-wasm WebAssembly architecture label Aug 10, 2020
@lewing lewing added this to the Future milestone Aug 10, 2020
@lewing lewing added area-VM-meta-mono and removed untriaged New issue has not been triaged by the area owner labels Aug 10, 2020
@ghost
Copy link

ghost commented Aug 10, 2020

Tagging subscribers to this area: @CoffeeFlux
See info in area-owners.md if you want to be subscribed.

@danroth27
Copy link
Member

I believe the main limitation here is browser support for threads. While Chromium based browsers and Firefox I believe now have threading support on desktop, I believe Safari still doesn't and most mobile browser also still don't: https://caniuse.com/?search=sharedarraybuffer.

@lewing Can you confirm?

@RChrisCoble
Copy link
Author

RChrisCoble commented Oct 27, 2020

The Uno team seems to be messing around in this space already.

https://platform.uno/blog/webassembly-threading-in-net/

https://emscripten.org/docs/porting/pthreads.html

@danroth27
Copy link
Member

@RChrisCoble Yup, that's all based on the work we've done in the .NET WebAssembly runtime to support threads. It just has limited browser applicability currently.

@RChrisCoble
Copy link
Author

@danroth27 thanks for the reply. So to put a fine point on the current status of task based parallelism using browser thread support: (cc'ing @lewing )

  1. The combined .Net 5/Blazor release will not support WASM task based parallelism, and everything will continue to run single threaded like the current Blazor bits (and JS).
  2. There is work in flight to support WASM task based parallelism in the .Net core runtime. Does this have a release vehicle? .Net 6?
  3. Even with the support of Get core-setup building in the consolidated repo. #2 above, it will only work in browsers that support threads.

@RChrisCoble
Copy link
Author

RChrisCoble commented Oct 27, 2020

For context on what we're trying to do. We want to take the .Net engine that drives this:

https://www.aveva.com/content/dam/aveva/images/cards/664x498/W009_ADNOC_10-20.jpg.rendition/mobile-1x.png

And run the exact same code in a browser using Blazor. This code makes heavy use of task based parallelism. It would be quite the success story for the power of Blazor, in my opinion. We also need .Net AOT compilation so we can draw with SkiaSharp. @mattleibow sounds like he's ready to knock that out when .Net 6 preview releases of AOT start dropping.

Then take that same work and drop it on mobile with MBB, and/or desktop with the features I now see slated for release with .Net 6/ASP.Net.

You guys are doing some extremely exciting work. Next year can't come fast enough.

@danroth27
Copy link
Member

There is work in flight to support WASM task based parallelism in the .Net core runtime. Does this have a release vehicle? .Net 6?

We're still in the process of planning for .NET 6, but given the state of browser support for threading and the amount of runtime work we already want to do for .NET 6 I'd say it's looking unlikely that multithreading will land for Blazor WASM in .NET 6.

We also need .Net AOT compilation so we can draw with SkiaSharp. @mattleibow sounds like he's ready to knock that out when .Net 6 preview releases of AOT start dropping.

I do expect that WebAssembly AoT compilation will land for .NET 6, and the current thinking is that this will enable SkiaSharp scenarios. Still lots to work out though - .NET 6 planning is still a work in progress.

@RChrisCoble
Copy link
Author

Thanks again @danroth27 for the information and counting that request under #17730.

Looking forward to evaluating beta AOT support when available next year!

@acceliance
Copy link

There is work in flight to support WASM task based parallelism in the .Net core runtime. Does this have a release vehicle? .Net 6?

We're still in the process of planning for .NET 6, but given the state of browser support for threading and the amount of runtime work we already want to do for .NET 6 I'd say it's looking unlikely that multithreading will land for Blazor WASM in .NET 6.

We also need .Net AOT compilation so we can draw with SkiaSharp. @mattleibow sounds like he's ready to knock that out when .Net 6 preview releases of AOT start dropping.

I do expect that WebAssembly AoT compilation will land for .NET 6, and the current thinking is that this will enable SkiaSharp scenarios. Still lots to work out though - .NET 6 planning is still a work in progress.

Oh oh Daniel, sounds weird. Every time multithreading is pushed away to some unknown future :-(

@danroth27
Copy link
Member

@lewing @lambdageek Possible duplicate of #68162?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants