.net 中的 TPL 与异步?

发布于 2024-10-08 04:23:23 字数 147 浏览 0 评论 0原文

我在 .net 4 中没有太多使用 TPL,但我知道它非常适合多核应用程序

,但在 PDC 中我看到他们宣布异步 CTP 和 TPL。我只在 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 announcing 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月隐月明月朦胧 2024-10-15 04:23:23

C# 5 中的异步功能将使用 TPL...当然,它只是一个库。异步方法将使使用 TPL 变得更加容易...给定适当的相对较低级别的异步操作(例如“异步获取网页”或“异步读取数据块”) 构建更高级别的异步操作将相当容易

就最佳实践而言, - 对于 TAP(基于任务的异步模式),有一个有趣的白皮书。对于 .NET 的一般并行编程,有一本由 Patterns and Practices 编写的书组,“使用 Microsoft .NET 进行并行编程” 以及 Joe Duffy 的书“Windows 上的并发编程” - 尽管后者稍微早于 TPL。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文