On Wednesday, 5 February 2014 at 14:40:46 UTC, Sean Kelly wrote:
Sort of. std.concurrency uses the actor model. So it's messaging, but not the CSP model used by Go. We should probably offer both, but for now it's just actors. And because you basically have one channel per thread, the limiting factor to date is how many threads you can sanely run simultaneously. Actor-oriented languages typically use green threads instead of kernel threads so the number of threads can scale. In Erlang, a "process" (ie. a thread) is equivalent to a class in D, so there tends to be a lot of them.

On a very well equipped machine 10.000 threads is about the maximum for the JVM. Now for D 1.000.000 kernel threads are not a problem!? Well, I'm a D newbie and a bit confused now... Have to ask some questions trying not to bug people. Apparently, a kernel thread in D is not an OS thread. Does D have it's own threading model then? Couldn't see that from what I found on dlang.org. The measurement result for fibers is that much better as for threads, because fibers have less overhead for context switching? Will actors in D benefit from your FiberScheduler when it has been released? Do you know which next version of D your FiberScheduler is planned to be included?

In Go you can easily spawn 100.000 goroutines (aka green threads), probably several 100.000. Being able to spawn way more than 100.000 threads in D with little context switching overhead as with using fibers you are basically in the same league as with Go. And D is a really rich language contrary to Go. This looks cool :-)

Reply via email to