【发布时间】:2012-02-04 20:39:05
【问题描述】:
这里是an article on how the Async CTP refresh can take advantage of the async "fast path"。
它提到了更高的效率等,但我什至不知道“快速路径”是什么?我想确定文章中的提示是否与我相关,但真的找不到“快速路径”的解释?
【问题讨论】:
标签: c# .net multithreading asynchronous async-ctp
这里是an article on how the Async CTP refresh can take advantage of the async "fast path"。
它提到了更高的效率等,但我什至不知道“快速路径”是什么?我想确定文章中的提示是否与我相关,但真的找不到“快速路径”的解释?
【问题讨论】:
标签: c# .net multithreading asynchronous async-ctp
“快速路径”是指正在等待的Task 在等待时已经完成。
如果发生这种情况,那么从您的方法返回的await 毫无意义,因为下一个延续将立即排队。
因此,在“快速路径”中,await 不会产生并继续在您的方法中执行。
【讨论】:
我可能错了,但我在这里的理解是,“快速路径”是当任务在您想要继续等待时已经完成时的场景。由于已经完成,可以避免很多设置延续和离开当前方法的开销。
【讨论】: