.Net中可用的并行技术 [英] Available parallel technologies in .Net

查看:85
本文介绍了.Net中可用的并行技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是.Net平台的新手.我进行了搜索,发现有几种方法可以在.Net中进行并行计算:

I am new to .Net platform. I did a search and found that there are several ways to do parallel computing in .Net:

    任务并行库(.Net 3.5)中的
  1. 并行任务.

  1. Parallel task in Task Parallel Library, which is .Net 3.5.

PLINQ,.Net 4.0

PLINQ, .Net 4.0

.Net 2.0异步编程(异步主要用于执行I/O繁重的任务,F#具有简洁的语法来支持此任务).之所以列出来,是因为在Mono中似乎没有TPL或PLINQ.因此,如果需要编写跨平台并行程序,则可以使用异步.

Asynchounous Programming, .Net 2.0, (async is mainly used to do I/O heavy tasks, F# has a concise syntax supporting this). I list this because in Mono, there seem to be no TPL or PLINQ. Thus if I need to write cross platform parallel programs, I can use async.

.Net线程.没有版本限制.

.Net threads. No version limitation.

您可以对此发表一些简短评论或在此列表中添加更多方法吗?

Could you give some short comments on these or add more methods in this list?

推荐答案

您确实需要进行大量研究才能确定如何有效地执行多线程.有一些很好的技术文章,是

You do need to do a fair amount of research in order to determine how to effectively multithread. There are some good technical articles, part of the Microsoft Parallel Computing team's site.

在我的头上,有几种方法可以进行多线程处理:

Off the top of my head, there are several ways to go about multithreading:

  1. Thread类.
  2. ThreadPool,它还支持I/O绑定操作和I/O完成端口.
  3. Begin*/End*异步操作.
  4. 使用SynchronizationContext的基于事件的异步编程(或"EBAP")组件.
  5. BackgroundWorker,它是定义异步操作的EBAP.
  6. .NET 4中的
  7. Task类(任务并行库).
  8. 并行LINQ.有一个 Rx 或"LINQ to Events"(尚未实现)拥有非Beta版本,但即将完成,并且看起来很有希望.
  9. (仅F#)异步工作流程.
  1. Thread class.
  2. ThreadPool, which also has support for I/O-bound operations and an I/O completion port.
  3. Begin*/End* asynchronous operations.
  4. Event-based asynchronous programming (or "EBAP") components, which use SynchronizationContext.
  5. BackgroundWorker, which is an EBAP that defines an asynchronous operation.
  6. Task class (Task Parallel Library) in .NET 4.
  7. Parallel LINQ. There is a good article on Parallel.ForEach (Task Parallel Library) vs. PLINQ.
  8. Rx or "LINQ to Events", which does not yet have a non-Beta version but is nearing completion and looks promising.
  9. (F# only) Asynchronous workflows.

更新:有一篇文章

Update: There is an article Understanding and Applying Parallel Patterns with the .NET Framework 4 available for download that gives some direction on which solutions to use for which kinds of parallel scenarios (though it assumes .NET 4 and doesn't cover Rx).

这篇关于.Net中可用的并行技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆