开发者

Task.Factory.StartNew() vs. TaskEx.Run()

Task.Factory.StartNew() basically receives an Action and 开发者_如何学Creturns 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 ?


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. :)


Stephen Toub covered it in his article. They are the same, one being shorthand for the other.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜