Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Task Parallel library implementation on mono?

Does Mono implement Task Parallel library? If so, how does performance compare between .NET and mono.

like image 556
Kumar Avatar asked Mar 02 '11 17:03

Kumar


2 Answers

This was implemented in Mono release 2.6.

From the release notes:

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.

Using ParallelFx, you can easily develop software that can automatically take advantage of the parallel potential of today multicore machines. 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.

like image 92
Brandon Frohbieter Avatar answered Oct 20 '22 00:10

Brandon Frohbieter


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). In short, my application's performance on Linux using mono is many many times slower. I am still trying to figure this out. I can run it from the mono console in windows with similar performance.

I have experimented with using mono's sgen garbage collector to no avail. The performance of my application on a Linux server running with mono is still dramatically slower.

Learning 8,258 sequences: 0:17 vs. 1:59 m:ss on Linux

Classify 921 sequences: 2.29 seconds vs. 11:05 mm:ss on Linux

See screen shots below.

enter image description here
enter image description here

like image 25
Jake Drew Avatar answered Oct 20 '22 01:10

Jake Drew