4 ms·
Can you elaborate on why there's a risk of a deadlock?
by endorphine 5y ago
Can you elaborate on why there's a risk of a deadlock?
- Merad 5y agoThe very short version is that by synchronously blocking on the async method your thread may end up holding a resource (thread context info or the calling thread itself) that the async method needs in order to run its continuations. Here are a couple of more detailed explanations: https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html https://blog.stephencleary.com/2012/07/dont-block-on-async-c... https://devblogs.microsoft.com/pfxteam/await-and-ui-and-deadlocks-oh-my/ https://devblogs.microsoft.com/pfxteam/await-and-ui-and-dead...
- endorphine 5y agoNow that's pretty much the answer I was looking for, I believe. This makes things much clearer!