News for hackers. Stuff that matters.
Re:Simple coroutines for games in C++ by quotemstr on Monday March 21, 2016 @08:38AM (#11327613)
getcontext and setcontext are fundamentally about saving and restoring CPU registers. setjmp and longjmp are also about saving and restoring CPU registers, and they (and related functions) give you much more complex of whether you want to save the signal mask. Since saving and restoring the signal mask is the objectionable part of setcontext, setjmp is a decent alternative.

If you want to unwind, just unwind. setjmp and setcontext neither help nor hurt you here.

Re:Simple coroutines for games in C++ by AnkhMorporkian on Monday March 21, 2016 @09:30AM (#11327898)
Fair enough. I still have doubts about whether that would scale up to millions or billions of coroutines, but I will defer to your knowledge in that it's probably Good Enough™ for most purposes. Thanks for the explanation!