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 ?
相关问题
- Custom TaskScheduler, SynchronizationContext?
- How do I create a multidimensional array of object
- Load script async?
- C# An asynchronous operation cannot be started at
- aio_write on linux with rtkaio is sometimes long
相关文章
- How do do an async ServiceController.WaitForStatus
- Efficient signaling Tasks for TPL completions on f
- With a Promise, why do browsers return a reject tw
- Asynchronous SHA256 Hashing
- Does aiohttp have ORM?
- Implement Async Interface synchronous [duplicate]
- Can the “dynamic” type vary safely in a generic co
- Can each Iteration of a for loop/for_each be done
Anders Hejlsberg talked about that briefly in an interview on Channel9. Apparently,
Task.Run
is just a shorthand forTask.Factory.StartNew
. Its still early CTP days so we're unsure thatTask.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.