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 ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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. :)
回答2:
Stephen Toub covered it in his article. They are the same, one being shorthand for the other.