The FMACJ Parallelization Framework makes it easier to write .NET code that uses multicore and even cluster machines efficiently. It has been inspired by MC# but instead of being a completely new language FMACJ works on almost all .NET languages because it's based on Attributes.
FMACJ is free software and available under the terms of the GNU General Public License.
The current beta release supports multicore parallelization only. Cluster support (task distribution via ethernet) will be implemented soon.
Here is a very basic example that shows how easily a method can be executed
in parallel threads by marking it with two attributes, [Fork] and
[Asynchronous]:
1: using System;
2: using Fmacj.Framework;
3: using Fmacj.Emitter;
4:
5: namespace Fmacj.Examples.HelloWorld
6: {
7: [Parallelizable]
8: public abstract class Program : IParallelizable
9: {
10: public static void Main()
11: {
12: ParallelizationFactory
13: .Parallelize(typeof(Program).Assembly);
14:
15: Program parallelized = ParallelizationFactory
16: .GetParallelized<Program>();
17:
18: for(int i=0; i<10; i++)
19: parallelized.SayHello();
20:
21: System.Threading.Thread.Sleep(1000);
22: }
23:
24: [Fork]
25: [Asynchronous]
26: public virtual void SayHello()
27: {
28: Console.WriteLine("Hello from Thread {0}",
29: System.Threading.Thread.CurrentThread.ManagedThreadId);
30: }
31: }
32: }
The output of the program should be something like this:
Hello from Thread 1 Hello from Thread 2 Hello from Thread 6 Hello from Thread 5 Hello from Thread 4 Hello from Thread 3 Hello from Thread 1 Hello from Thread 1 Hello from Thread 1 Hello from Thread 7
On a multicore machine the output looks rather scrambled because
Console.WriteLine gets a little confused when called by
multiple threads at a time. If you are confused, too (i.e. what is
ParallelizationFactory and why the hell is Program abstract?) go on reading
here.
This site is still under construction.