Any good implementation of Actors for C#?

Viewed 39063

Is there any good implementation of actors concurrency model for .net/c#?

I have to optimize a c# routine and i think that actors model fits perfectly as a solution for my problem. Unfortunately i have experience only with scala implementation.

13 Answers

You should have a look at MS Concurrency & Coordination Runtime (CCR), and the Decentralized Software Services (DSS), part of Robotic Studio.

These frameworks would allow you develop loosely coupled services that fulfill most of the actor-approach requirements.

Axum would be the best fit, unfortunately it's still in some sort of alpha/beta phase (UPDATE it has been killed in Feb. 2011). I use it for my research and must say that the general direction is great and it has enormous potential.

Not C# but C++ is Microsoft's Asynchronous Agents Library which gives you all the features that you need.

Have a good look at Parallel related features of .NET 4.

Hope it helps!

NAct is an actors framework for .NET which takes a really easy-to-use approach. (Disclaimer: I wrote it)

The message passing between two actors is just a method call between two objects. You have to make sure that all method arguments are immutable, and it will be thread-safe.

It works by wrapping your objects in a proxy that deals with the thread switching. All the normal .NET features, particularly events, are dealt with correctly, so you can write normal code and thread marshalling will happen on its own.

There's even a branch with support for C# 5 async/await.

I don't know of any implementations for C#, but there's a whole new programming language based on the Actor model by Microsoft. It's called Axum:

Axum (previously codenamed Maestro) is a domain specific concurrent programming language, based on the Actor model, being developed by Microsoft. It is an object-oriented language based on the .NET Common Language Runtime using a C-like syntax which, being a domain-specific language, is intended for development of portions of a software application that is well-suited to concurrency. But it contains enough general-purpose constructs that one need not switch to a general-purpose programming language (like C#) for the sequential parts of the concurrent components.

Related