Second Draft: Coroutines

Sebastiaan Koppe mail at skoppe.eu
Fri Jan 24 20:56:56 UTC 2025


On Thursday, 23 January 2025 at 23:09:42 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
>
> On 24/01/2025 10:17 AM, Sebastiaan Koppe wrote:
>> On Thursday, 23 January 2025 at 20:37:59 UTC, Richard (Rikki) 
>> Andrew Cattermole wrote:
>> You don't need to describe how scheduling works, just the 
>> mechanism by which a scheduler gets notified when a coroutine 
>> is ready for resumption.
>> 
>> Rust has a Waker, C++ has the await_suspend function, etc.
>
> Are you wanting this snippet?

No, not specifically. I am requesting the DIP to clarify the 
mechanism by which a scheduler is notified when a coroutine is 
ready for resumption, not the specific scheduling itself.

The snippet you posted raises more questions than it answers to 
be honest. First of all I still don't know what a 
GenericCoroutine or what a Future is.

It seems that in your design coroutines are only able to wait for 
other coroutines. This means you need to model async operations 
as coroutines in order to suspend on them. Why was this done? 
C++'s approach of having an awaiter seems simpler. For one it 
allows the object you are awaiting on to control the continuation 
directly.


More information about the dip.development mailing list