News for hackers. Stuff that matters.
Re:Cooperative Threading by amelius on Wednesday November 13, 2019 @06:07AM (#21522854)
> Unlike coroutines, each cooperative thread has its own stack frame.

This seems to be incorrect. See:

https://stackoverflow.com/questions/28977302/how-do-stackles...

> In contrast to a stackless coroutine a stackful coroutine can be suspended from within a nested stackframe.

It seems the author is trying to reinvent stackful coroutines, and calls them "cooperative threads".

Re:Cooperative Threading by byuu on Wednesday November 13, 2019 @06:15AM (#21522897)
No one really agrees on the exact terminology. There are stackful and stackless coroutines, continuations, green threads, fibers, cooperative threads, etc. Generally when people talk about coroutines without a qualification they are meaning the stackless variety. I personally consider a coroutine with a stack frame to be a cooperative thread, but understandably not everyone will agree on naming. The nomenclature hopefully should not affect the broader message of the article though.

In any case, I am not so much trying as I already have. C++ does not have stackful coroutines. I implemented them via my libco library and have been using them for over a decade now.

Re:Cooperative Threading by gpderetta on Wednesday November 13, 2019 @06:14AM (#21522889)
You could argue that coroutines as originally specified implied stackless-ness: it was just a generalization of a subroutine that could return (to its immediate caller) multiple times, so at most one stack frame need to be preserved.

A better name for stackful coroutines is one-shot continuations.