19 May 2009 @ 7:47 AM 
 

Microsoft Axum: .NET Language for Parallel Computing

 

Followed by F#, one more language is coming out from Microsoft .NET campus named “Axum”. 

Based on Concurrency and Coordination Runtime (CCR) in Microsoft Robotic Studio, Axium is a language which allows to define your application to do parallel computing in your .NET applications.

Axum comes into play for the following:

  • Asynchronous behaviour
  • Dealing with concurrency
  • Dealing with partial failure

We know that asynchronous enables to scale our code better with greater responsiveness.  However, callback structure lacks the readability.  Concurrency is a way to utilizes the resources well to execute code in parallel with safe sharing of state.  Unlike typical OO languages, Axum is designed for modeling applications with concurrency behaviour, so it deviates from object-oriented programming.   

The core aspects in Axum are:

  • Agent.  It is an autonomous entity which communicate with other agent via messages, act on the data received from other agents.  ConsoleApplication is one such agent for representing System.Console.
  • Channel.  This is medium for transmitting messages from one agent to another.
  • Ports.  This is used to specify the direction of messages.  A channel consists of input and output port.
  • Domain. This enables to group agents so that state can be shared between the agents.

Let us see a sample code taken from Axum Programing Guide.

 

using System;
using System.Concurrency;
using Microsoft.Axum;

namespace HelloAxum
{
    public domain Program
    {
        channel Adder
        {
            input int Num1;
            input int Num2;
            output int Sum;
        }
       
        agent AdderAgent : channel Adder
        {
            public AdderAgent()
            {
                int result = receive(PrimaryChannel::Num1) +
                receive(PrimaryChannel::Num2);
                PrimaryChannel::Sum <-- result;
            }
        }
       
        agent MainAgent : channel Microsoft.Axum.Application
        {
            public MainAgent()
            {
                var adder = AdderAgent.CreateInNewDomain();
                adder::Num1 <-- 10;
                adder::Num2 <-- 20;
    
                var sum = receive(adder::Sum);
               Console.WriteLine(sum);
               Console.ReadLine();
              PrimaryChannel::ExitCode <-- 0;
            }
        }
    }
}

Adder is a channel which contains two input port and one output port.  AdderAgent implements Adder channel.  It receives the two input port values, add these two and set the result into PrimaryChannel.  The primary channel actually refers Adder in AdderAgent.  MainAgent is another agent which is actually a main Axum application.  It creates AdderAgent and send the message to it.  The result is received on “sum”.

Download and drive Axum from https://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=cfe70d5d-37aa-4c4c-8eeb-d4576c41baa2

Share This: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
Tags Tags: , Axum, CCR, Concurrency, Coordination, Parallel Computing
Categories: .NET
Posted By: udooz
Last Edit: 19 May 2009 @ 03 15 PM

Permalink
 

Responses to this post » (One Total)

 
  1. Hi
    His article was very quite written. I found great objective. My friend notices ten.

    Reply to this Comment
 Comment Meta:
RSS Feed for comments
TrackBack URI
\/More Options ...
Register an account
Change Theme...
  • Users » 1
  • Posts/Pages » 60
  • Comments » 67
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

AsFeeds



No Child Pages.