Erlang style concurrency in the D programming language

Viewed 3904

I think Erlang-style concurrency is the answer to exponential growth of core count. You can kind of fake it with other main stream languages. But the solutions always leave me wanting. I am not willing to give up multi-paradigm programming (C++/D) to switch to Erlang's draconian syntax.

What is Erlang-style concurrency:

From one of the language authors(What is Erlang's concurrency model actually ?):

  • Lightweight concurrency.
    Cheap to create threads and cheap to maintain insane numbers.
  • Asynchronous communication.
    Threads only communicate via messages.
  • Error handling.
  • Process isolation.

Or from an informed blogger (What is Erlang-Style Concurrency?):

  • Fast process creation/destruction
  • Ability to support >> 10 000 concurrent processes with largely unchanged characteristics.
  • Fast asynchronous message passing.
  • Copying message-passing semantics (share-nothing concurrency).
  • Process monitoring.
  • Selective message reception.

I think D's message passing can accomplish most of these features. The ones I wonder about are ">>10,000 concurrent processes(threads)" and "fast process creation/destruction".

How well does D handle these requirements?

I think that to support them correctly you'd have to use green threads. Can D's message passing features be used with green threads library?

3 Answers
Related