I'm trying to make coroutine and continuation with C. I realized I need some kind of spaghetti stack. Is it possible to execute a function within a new call-stack? Of course within single thread. How can I make a new, separated call-stack, and execute some code on it?
check out makecontext/swapcontext.
If those aren't available, then you could use setjmp/longjmp, but those are a little more complex.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With