News for hackers. Stuff that matters.
Re:Show HN: Libconcurrent – Coroutines in C by geofft on Wednesday January 13, 2016 @11:06AM (#10895278)
Cool!

A co-TA and I ported the concurrency library in JOS, MIT's teaching operating system, to regular UNIX:

https://github.com/geofft/vireo

It uses the standard-ish library functions setcontext and getcontext to avoid an assembly dependency. ("POSIX.1-2008 removes the specification of getcontext(), citing portability issues, and recommending that applications be rewritten to use POSIX threads instead.")

Re:Show HN: Libconcurrent – Coroutines in C by gpderetta on Wednesday January 13, 2016 @11:54AM (#10895667)
*context are unfortunately quite slow as they require a system call to update the signal mask. The sigaltstack trick popularized by Pth is probably still more portable and faster.

BTW makecontext and friend were made obsolete by posix for a technicality: makecontext signature isn't expressible any longer in a strictly conforming C99 applications, although in practice it will work with any C compiler.

Ironically this happened around the same time that coroutines started becoming popular again.