28 ms·
Getcontext/setcontext has always allowed for coroutines in C. This just adds a sugar layer of nonblocking functions that allows a runtime layer to switch betwee
by smegel 12y ago
Getcontext/setcontext has always allowed for coroutines in C. This just adds a sugar layer of nonblocking functions that allows a runtime layer to switch between contexts (coroutines), just like Go.
- octetta 12y agoThe ucontext stuff is nice but why was it deprecated? It's generally not a problem on x86, but in my experience for other platforms, it gets messy quickly. It would be nice if a replacement or a "de-deprecated" was around.
- Blackthorn 12y agoThat question has seriously bothered me too. OS threads are not a replacement as they are preemptive. The deprecation was way premature.
- tedunangst 12y agomakecontext cannot be correctly represented by the C type system.
- frankerz 12y agoI'm not very good at C, but from my understanding this library uses longjmp functions which means it's cooperative multithreading rather than preemptive isn't it?
- rumcajz 12y agocorrect