MC# programming language is an extension of C# language
and is based on .NET platform.
This language is an adaptation of the basic
idea of the Polyphonic
C# language for the case
of
multi-threaded distributed
computations.
The novel features of the MC# are
Async- and movable methods are the only
way to create and run the concurrent distributed
processes (threads). These
methods are declared as
modifiers async method_name ( arguments
) { < method_body > } |
or
modifiers movable method_name ( arguments
) { < method_body > } |
using System; public class HelloWorld { public static void Main ( String [] args ) { new HelloWorld().printHello(); } public async printHello ( ) { Console.WriteLine ( "Hello, async world :-) !" ); } } |
handler getInt int ( ) & channel sendInt ( int x ) { return ( x ); } |
modifiers handler handler_name return_type ( args ) |
a.sendInt ! ( x ); |
a.sendMultiple ! ( x1, x2, x3 ); |
a.sendSignal ! ( ); |
int m = (int) a.getInt ? ( ); |
Console.WriteLine ( "Result is " + a.getInt ( ) ); |
public
handler equals bool ( ) & channel c1 ( int x
) & channel c2 ( int y ) { if ( x == y ) return ( true ); else return ( false ); } |
public
handler insertObject int ( MyObject[]
objects ) & channel sendObject ( int n, MyObject obj ) { < chord body > } . . . myMethod ( a.insertObject, a.sendObject ); // method call . . . public void myMethod ( handler int (MyObject[] ) insertObject, // method channel (int, MyObject) sendObject ) // declaration { < method body > } |