4 ms·
Yeah, I think he’s referring to what’s described in more detail here: https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html https://www.chiark.greenend.o
by kindfellow92 9y ago
Yeah, I think he’s referring to what’s described in more detail here: https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
- andreasgonewild 9y agoBeen there, done that :) It's a neat trick, but the issue for me is that you still need to pass a separate struct for state which breaks the illusion enough that you might as well just write an ordinary iterator.
- kosma 9y agoMost well-written portable interrupt code needs to pass an explicit context anyway, so... it's not as bad as it sounds.
- kindfellow92 9y agoI agree. If you want user-level threading, just use a stack swapping library like libpth.