-
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
Does Blazor WebAssembly support multi threading? #14253
Comments
If you are calling out to servers etc then those calls will be async. If you have a long-running in-process task then you can yield execution cycles like this...
|
Thanks for contacting us @Madhust. Blazor currently is single threaded and executes everything on the "UI thread". The general guidance for long running jobs is:
The most important thing to remember is to never call .Result or .Wait() as that will create a deadlock in your application as when async work tries to return to the UI thread, it won't be able to due to the fact that it is blocked in the .Result or .Wait() task. If you need to check on the results of a task you can keep a reference to it on a field in the component or do some work as a continuation for the task. Hope this helps. @danroth27 Do you have your long running async sample? That should go in the docs. This guidance too, once we've reviewed it more thoroughly. |
While reading the below post, this doubt came to my mind.
https://visualstudiomagazine.com/articles/2019/09/18/blazor-webassembly.aspx
The above bold line says that Blazor App will reside in the browser UI thread and all updates are handled within the same process. So I have the below questions regarding this.
I might have misunderstood the above statement, I appreciate if someone correct me if i am wrong.
The text was updated successfully, but these errors were encountered: