Search code examples
c#.netconcurrencyerlanglightweight-processes

Erlang-style light-weight processes in .NET


Is there any way to implement Erlang-style light-weight processes in .NET?

I found some projects that implement Erlang messaging model (actors model). For example, Axum. But I found nothing about light-weight processes implementation. I mean multiple processes that run in a context of a single OS-thread or OS-process.


Solution

  • I think the F# MailboxProcessor is what you're looking for Alexey. Using the MailboxProcessor you can define tens of thousands of agents within one .NET process much like you can spawn tens of thousands of lightweight processes in Erlang.

    This MSDN post by Don Syme is a great introduction.

    If you're coming to .NET from an Erlang background keep in mind you're going to be missing lots of OTP goodies (supervisors, location transparency, mnesia, ...).