问题描述
Task.Factory.StartNew()基本上接收操作,并返回一个任务。在异步CTP我们有TaskEx.Run(),这也接收操作,并返回一个任务。他们似乎做同样的事情。为什么TaskEx.Run()介绍?
Task.Factory.StartNew() basically receives an Action and returns a Task. In The Async CTP we have TaskEx.Run() which also receives an Action and returns a Task. They seem to do that same thing. Why TaskEx.Run() was introduced ?
推荐答案
安德斯·海尔斯伯格谈到了短暂采访时 。显然, Task.Run
仅仅是 Task.Factory.StartNew
的简写。其还早CTP天所以我们不能确定 Task.Run
将使它诠释。我个人希望它不会因为它是一种多余的。 :)
Anders Hejlsberg talked about that briefly in an interview on Channel9. Apparently, Task.Run
is just a shorthand for Task.Factory.StartNew
. Its still early CTP days so we're unsure that Task.Run
will make it int. I personally hope it won't because it's kind of redundant. :)
这篇关于Task.Factory.StartNew()与TaskEx.Run()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!