3 ms·
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 fo
by spc476 8y ago
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 https://github.com/spc476/C-Coroutines
Edit: clarification of what language my coroutines are implemented in.