开发者

TPL vs Async in .net?

开发者 https://www.devze.com 2023-01-31 04:40 出处:网络
i didnt use TPL that much in .net 4 but i know its great for multi-core Applications but in PDC i saw them a开发者_Go百科nnouncing Async CTP & i only saw Async in F#

i didnt use TPL that much in .net 4 but i know its great for multi-core Applications

but in PDC i saw them a开发者_Go百科nnouncing Async CTP & i only saw Async in F#

my Question is what is the difference between them & what are the best practices for each of them

thanks in advance


The async features in C# 5 will use the TPL... which is just a library, of course. Asynchronous methods will simply make it a lot easier to use the TPL... given appropriate relatively-low-level async operations (e.g. "fetch a web page asynchronously" or "read a block of data asynchronously" it will be fairly easy to build higher-level asynchronous operations.

In terms of best practices - for TAP (Task-based Asynchronous Pattern) there's an interesting white paper. For parallel programming in general with .NET, there's a book by the Patterns and Practices group, "Parallel Programming with Microsoft .NET" and also Joe Duffy's book "Concurrent Programming on Windows" - although the latter predates the TPL slightly.

0

精彩评论

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