English 中文(简体)
mono problems with parallel extensions
原标题:

i have a program written in visual studio 2008 c# which uses

            System.Threading.Tasks.Paralell.For(...

now i want to run it in linux environment using mono, is it possible? if so how?

currently i have Mono Jit compiler version 2.4.2.3 , it cannot run the above program...

问题回答

Mono 2.4.2.3 does not support Parallel LINQ. If you re not afraid of compiling mono from sources, I d recommend doing that.

As you may know Thread management is very tied and closed to the underlying OS. The Mono team has not yet completed an implement of the TPL for Linux and I have some doubt that they will be able to achieve it soon as they have to implement it to every OS they support.

In fact you get the beggining of an implementation made during the Google Summer of Code 2008 by Jeremie Laval : http://code.google.com/p/mono-soc-2008/source/browse/#svn/trunk/parallelfx

You can get more info about this implementation here : http://blog.netmedia.info/2008/07/29/c-30-and-parallel-fxlinq-in-mono/

You could try the PFX implmentation by Jeremie Laval for Mono, but I have found that it is subtly different than the Microsoft implementation, so there may be some porting required to get things to work correctly.

That being said, another potential possibility (untested) would be to use the new Reactive Framework for .NET 3.5sp1, and see if it works on Mono. It includes a backport of the PFX libraries, in their current API. It may work correctly on Mono (but, as I said, it s not tested or supported there).





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签