BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Article: Using the Concurrency and Coordination Runtime

Article: Using the Concurrency and Coordination Runtime

Bookmarks

Nick Gunn provides a practical introduction using the Concurrency and Coordination Runtime. CCR radically changes the way multi-threaded applications are written in .NET, shifting the focus from threads and locks to lightweight, asynchronous tasks. The Concurrency and Coordination Runtime, also known as CCR, offers actor-style concurrency for .NET applications. Nick describes the CCR as:

The Concurrency and Coordination Runtime (CCR) is an asynchronous message-passing library for the .NET platform that provides a set of small but powerful primitives that enable a different approach to structuring applications. The effective use of the CCR will result in an application that will be more responsive, will scale better and will be more robust. The intriguing aspect about it is that it can deliver these benefits at the same time as reducing (and sometimes removing) the need for you to explicitly deal with threads (and failures on these threads), locks, mutexes and other low-level synchronization primitives.

Nick lives in Sydney where he works for Macquarie Bank, as a senior developer (trading systems). He has previously worked in London for HSBC, Barclays Capital and Credit Suisse. His professional interests include distributed systems and models of computation. He graduated from Manchester University with a degree in Computing and Information Systems. He maintains a technical blog on CCR and related topics at http://iodyner.spaces.live.com/

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Java implementation possible?

    by Srdan Srepfler,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Would it be possible to implement CCR on top of the JVM (having no yield or any other language support needed by the CCR)?

  • There are Scala and Erlang for java

    by Ken Yu,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Not exactly based on java though.

  • Re: Java implementation possible?

    by Jonathan Allen,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I don't see why not. Yield is just a compiler trick, languages like VB.NET can use the CCR by implementing the IEnumerable state machine manually. It's painful, but certainly possible.

  • Does this compile?

    by Miroslav Paskov,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I was trying the examples and this does not compile:

    new Arbiter< Arbiter < string > >(port, ProcessMessages)

    since Arbiter is static. Am I using a different version or is there anything else?

    Ccr.Core Version: 2.0.913.0

    Well done for the article, I was looking for something like this!

  • coding written

    by Nicko SU,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    The article is so cool. I never know about it :)
    IMHO the code that is written in side effect. For example I get code :

    static IEnumerator<ITask> ProcessMessages(Port<string> port)
    {
    bool fDone = false;
    while (!fDone)
    {
    yield return port.Receive(message =>
    {
    if (String.IsNullOrEmpty(message))
    fDone = true;
    else
    Console.WriteLine(message);
    });
    }
    Console.WriteLine("Finished");
    }
    For me when you doing some yield, the code should not change other states so it make me confuse
    </string></itask>

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT