And computed gotos, which just jumps to a pointer, which is a gcc extension. That's totally crazy, but sort of awesome.
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.
The 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.
That question has seriously bothered me too. OS threads are not a replacement as they are preemptive. The deprecation was way premature.
makecontext cannot be correctly represented by the C type system.
I'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?