Processes and Channels, cf. goroutines.

Sean Kelly sean at invisibleduck.org
Wed Feb 5 06:40:44 PST 2014


On Wednesday, 5 February 2014 at 10:56:23 UTC, Bienlein wrote:
> On Wednesday, 5 February 2014 at 01:02:37 UTC, Sean Kelly wrote:
>> Okay, just for fun, here are some results with the new 
>> scheduler.
>>  I injected periodic yields into the code to simulate the
>> yielding that would happen automatically if the code was using
>> send and receive.  First the code:
>
> Hi Sean,
>
> with "send and receive" you mean adding to a channel and doing 
> a blocking take on it? Just for me to build up an understanding.

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.


More information about the Digitalmars-d mailing list