BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Article: Using the Concurrency and Coordination Runtime

by Jonathan Allen on Jan 28, 2009 |

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/

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.

Tell us what you think

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

Email me replies to any of my messages in this thread

Java implementation possible? by Srdan Srepfler

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

Not exactly based on java though.

Re: Java implementation possible? by Jonathan Allen

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

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

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

5 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT