使用.Net 4.0新功能进行并行任务

发布于 2024-09-19 17:06:34 字数 280 浏览 2 评论 0原文

我之前问过一个关于设计接收视频文件、发送视频文件的服务的问题到编码服务,等待编码完成,然后下载文件。

我开始为此编写代码,我的一位同事建议我使用 .Net 4.0 新功能,而不是使用 BackgroundWorker 编写代码。我读过一些书,并行功能听起来很棒。我还应该实施更多新功能吗?我是 .net 4.0 的新手。

谢谢!

I've previously asked a question about designing a service that receives video files, sends them to an encoding service, waits for the encoding to be completed, and then downloads the files.

I started writing the code for that and one of my workmates suggested I use .Net 4.0 new features, instead of writing it using BackgroundWorker. I've done some reading and the Parallel feature sounds great. Are there any more new features I should implement? I'm new to .net 4.0.

Thanks!

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

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

发布评论

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

评论(1

谈情不如逗狗 2024-09-26 17:06:35

并行扩展无疑是一个不错的选择。您可能需要考虑的另一个是响应式扩展,它实现了“相反,推”模型。您需要花一点时间才能理解,但它非常优雅 - 并且可能非常适合您的异步模型。

Parallel Extensions is certainly one good option here. Another you might want to consider is Reactive Extensions, which implements a "push" model instead. It takes a little while to get your head round, but it's very elegant - and might work very well with your asynchronous model.

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