Re:Fibers: An Elegant Windows API
by spc476 on Friday March 29, 2019 @07:31PM
(#19526492)
Usually using C's `setjmp()` and `longjmp()` functions (but I consider that an ugly hack). I did an implementation for both x86-32 and x86-64 [1] that works for Linux and Mac OS-X that's for C (written in assembly). I doubt it will work for C++, and I'd be a bit hesitant to use it for production, but it's surprisingly simple.
[1] https://github.com/spc476/C-Coroutines
Edit: clarification of what language my coroutines are implemented in.