Open Xyncgas opened 3 years ago
I have to maintain two code base now just because my libraries contains Parallel.For which apparently uses Task.wait(). please take this seriously folks
@Xyncgas thanks for contacting us.
The browser is a single threaded runtime (except for wasm threads that are not widely supported on all platforms). If a library blocks the main thread, there's no additional thread where work can resume and unblock the blocked thread.
This is not a decision that we made, it's a limitation imposed by the environment.
Tagging subscribers to this area: @mangod9 See info in area-owners.md if you want to be subscribed.
Author: | Xyncgas |
---|---|
Assignees: | - |
Labels: | `area-System.Threading`, `untriaged` |
Milestone: | - |
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Author: | Xyncgas |
---|---|
Assignees: | - |
Labels: | `arch-wasm`, `area-System.Threading`, `untriaged` |
Milestone: | - |
I want to keep talking about this issue. It's in my opinion a bug, hear me out. We can't pause a thread in blazor because it's running on one thread and it's async all the way that was the decision.
but, this affects the portability of codes, even when they followed best practice, while they can target .net standard 2.0 - mono.wasm - blazor they are still going to break.
how about we fix this by, in my opinion I propose defining what happens when you call .wait() either : block the running thread and let people intentionally make this trade off, or making blazor multi-threaded, or simulate async behavior by forcing it to yield control after timeout that's decided by the .net rt