简体   繁体   English

单声道上的任务并行库实现?

[英]Task Parallel library implementation on mono?

Does Mono implement Task Parallel library? Mono是否实现了Task Parallel库? If so, how does performance compare between .NET and mono. 如果是这样,.NET和mono之间的性能如何比较。

This was implemented in Mono release 2.6. 这是在Mono 2.6版中实现的。

From the release notes: 从发行说明:

ParallelFx ParallelFx

This release includes some components of the ParallelFx framework that were developed as part of Google Summer Of Code 2008 & 2009. More precisely, it contains the Task Parallel Library and Data Structures For Coordination. 此版本包括ParallelFx框架的一些组件,这些组件是作为Google Summer Of Code 2008和2009的一部分开发的。更准确地说,它包含任务并行库和数据结构协调。

Using ParallelFx, you can easily develop software that can automatically take advantage of the parallel potential of today multicore machines. 使用ParallelFx,您可以轻松开发能够自动利用当今多核机器并行潜力的软件。 For that purpose, several new constructs like futures, parallel loops or concurrent collections are now available. 为此,现在可以使用一些新的构造,如期货,并行循环或并发集合。

To use this code you have to manually enable the .NET 4 profile using the --with-profile4=yes switch at configure stage. 要使用此代码,您必须在配置阶段使用--with-profile4 = yes开关手动启用.NET 4配置文件。

In my own experience, I have a highly parallel program in C# for the learning and classification of gene sequence data which makes very heavy usage of the Task Parallel Library features such as Parallel.ForEach, Parallel.For, Task.Factory.StartNew(), and many structures from from the Collections.Concurrent namespace (Blocking Collections, Concurrent Dictionaries, Concurrent Bags etc). 在我自己的经验,我已经在C#中的学习和基因序列数据的分类,这使得的任务并行库的功能,如Parallel.ForEach,的Parallel.For,Task.Factory.StartNew非常沉重的使用高度并行程序()来自Collections.Concurrent命名空间的许多结构(阻塞集合,并发字典,并发包等)。 In short, my application's performance on Linux using mono is many many times slower. 简而言之,我的应用程序在使用mono的Linux上的性能要慢很多倍。 I am still trying to figure this out. 我仍然想弄明白这一点。 I can run it from the mono console in windows with similar performance. 我可以在具有类似性能的Windows中从单声道控制台运行它。

I have experimented with using mono's sgen garbage collector to no avail. 我已经尝试使用mono的sgen垃圾收集器无济于事。 The performance of my application on a Linux server running with mono is still dramatically slower. 我的应用程序在运行单声道的Linux服务器上的性能仍然显着降低。

Learning 8,258 sequences: 0:17 vs. 1:59 m:ss on Linux 学习8,258个序列: 0 :17 vs. 1:59 m:Linux上的ss

Classify 921 sequences: 2.29 seconds vs. 11:05 mm:ss on Linux 对921序列进行分类: 2.29秒vs. 11:05 mm:Linux上的ss

See screen shots below. 请参阅下面的屏幕截图

在此输入图像描述
在此输入图像描述

Did you try changing the min/maxthreads? 你有没有尝试改变min / maxthreads?

System.Threading.ThreadPool.SetMaxThreads(mWorker, mWorker);
System.Threading.ThreadPool.SetMinThreads(10, 10);

You are operating way beyond me, but I found that nothing was getting done. 你的操作超越了我,但我发现没有任何事情要做。 So I set it to 5 * number of cpu cores and it snapped right out of it! 所以我把它设置为5 *个cpu核心数量,然后它突然出现了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM