3 ms·
It's exactly what it says, it's a coroutine with its own stack. A fiber isn't to some degree a stackful coroutine, it is a stackful coroutine. A stackless cor
by nickelpro 3y ago
It's exactly what it says, it's a coroutine with its own stack.
A fiber isn't to some degree a stackful coroutine, it is a stackful coroutine.
A stackless coroutine does not have a its own stack, it uses the calling context's stack and therefore can only yield to the calling context from the top-level coroutine function. A stackful coroutine has its own stack, and so can yield to the calling context from anywhere.
As far as how to implement, I always liked Malte Skarupke's blog post on the subject: https://probablydance.com/2013/02/20/handmade-coroutines-for-windows/ https://probablydance.com/2013/02/20/handmade-coroutines-for...