News for hackers. Stuff that matters.
Re:Protothreads: Lightweight Stackless Threads in C by mrpippy on Thursday May 16, 2019 @01:29AM (#19926392)
That was the original implementation (and still used for non-GNU C).

On GCC and Clang though, labels-as-values allows a cleaner implementation: https://github.com/Akagi201/protothreads/blob/master/include...

Re:Protothreads: Lightweight Stackless Threads in C by dividuum on Friday May 17, 2019 @05:48PM (#19943894)
Woo. I wrote the original implementation for that 14 years ago. I discovered local labels when we tried to write some code that used the had multiple yields in the same line. Due to how the switch based implementation worked, this wasn't possible, so I looked for other solutions.