你的位置: 码友网首页 / 资讯源列表 / The danger of async/await and .Result in one picture

关于[The danger of async/await and .Result in one picture]的摘要:

Sync over async in .NET is always bad and there is no better advice than just to avoid it. What does “Sync over async” mean exactly? It happens if you synchronously wait on an asynchronous operation result with the help of .Result, .Wait or similar. Why is it bad? First of all, it blocks (wastes) one thread to wait on a result – which may lead to threads starvation. But even worse, it may deadlock your operation and (sometimes) the whole application.

原文地址: https://tooslowexception.com/the-danger-of-asyncawait-and-result-in-one-picture/

收录时间: 2020-06-04 浏览量: 1604 分类: .NET

| 0 收藏 | 0