Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Is one SynchronisationContext used over multiple threads/tasks?

$
0
0

Is there a situation where a SynchronisationContext is used over multiple threads/tasks in Blazor?

I want to determine whether a method has an components BuildRenderTree in its call stack. To do so i created a custom ComponentBase where i wrap the BuildRenderTree with custom code. My approach would be to check the SynchronisationContext. As i understood it is uniquely for one component, and therefor the execution of BuildRenderTree will not be "interrupted" by other threads/tasks with the same SynchronisationContext set. Did i get this right? Are there any pitfalls with using the SynchronisationContext for this case? (i am not sure if the components used in the razor file are rendered within the BuildRenderTree but i would handle this case correctly alreay)


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>