异步快速路径
它提到诸如更高的效率等,但我什至不知道“快速路径”是什么?我想确定文章中的提示是否与我相关,但无法真正找到“快速路径”的解释?
Here is an article on how the Async CTP refresh can take advantage of the async "fast path".
It mentions things like greater efficiency etc, but I dont even know what the "fast path" is? I would like to determine whether the tips in the article are relevant to me, but could not really find an explanation of "fast path"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“快速路径”是指正在等待的任务在等待时已经完成。
如果发生这种情况,则从方法返回
await
就没有意义,因为下一个延续将立即排队。因此,在“快速路径”中,
await
不会产生结果,并且会在您的方法中继续执行。The "fast path" is when the
Task
being awaited has already completed by the time it is awaited.If this happens, then there is no point in
await
returning from your method because the next continuation will be queued immediately.So in the "fast path",
await
does not yield and execution continues in your method.我可能是错的,但我的理解是“快速路径”是当任务在您想要执行等待延续时已经完成的情况。由于它已经完成,因此可以避免设置延续和离开当前方法的大量开销。
I may be wrong, but my understanding here is that the "fast path" is the scenario when the task turns out to be completed already at the point you want to do an await continuation. Since it is already complete, a lot of the overhead in setting up the continuation and leaving the current method can be avoided.