First Draft: Coroutines

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Nov 7 16:03:45 UTC 2024


On 08/11/2024 4:31 AM, Bienlein wrote:
> On Tuesday, 6 August 2024 at 02:00:39 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>> On 06/08/2024 6:11 AM, Sebastiaan Koppe wrote:
>>> It is similar to the approach Go takes in that it makes calling C 
>>> functions more difficult though.
>>
>> Go goes a bit further than that, their goroutines are effectively in 
>> their own calling convention.
>>
>> We cannot replicate what they did, as we have strict requirements on 
>> interactivity to C. I did check with Walter and he confirmed it wasn't 
>> acceptable from his stance either.
> 
> D has fibers with which you can implement a thread model similar to the 
> one in Go based on channels with blocking takes using green threads.

They are both stackful coroutines yes, but they are implemented 
completely differently.

D's fibers cannot scale.



More information about the dip.development mailing list