Opportunities for D
logicchains via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 9 23:32:29 PDT 2014
On Thursday, 10 July 2014 at 05:58:56 UTC, Andrei Alexandrescu
wrote:
> We already have actor-style via std.concurrency. We also have
> fork-join parallelism via std.parallel. What we need is a
> library for CSP.
The actor-style via std.concurrency is only between 'heavyweight'
threads though, no? Even if lightweight threads may be overhyped,
part of the appeal of Go and Erlang is that one can spawn tens of
thousands of threads and it 'just works'. It allows the server
model of 'one green thread/actor per client', which has a certain
appeal in its simplicity. Akka similarly uses its own lightweight
threads, not heavyweight JVM threads.
Think of it from the perspective of attracting Erlang
programmers, or Java/Scala programmers who use Akka. If they
tried out std.concurrency and found that it failed horribly when
trying to spawn fifty thousand actors, they'd be unlikely to
stick with the language.
Message passing between lightweight threads can also be much
faster than message passing between heavyweight threads; take a
look at the following message-passing benchmark and compare
Haskell, Go and Erlang to the languages using OS threads:
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=threadring
More information about the Digitalmars-d
mailing list