Re:Show HN: Smart pointers for the C programming language
by tormeh on Wednesday January 14, 2015 @12:19PM
(#8887590)
It is pretty impressive, actually. C, in general, does not have nice things. And it seems like this is on purpose. I think you're supposed to use C++ if you want nice things on top of C. That said, I've tried making green threads for C and it was a nightmare. I got something working though, so it's possible, but still a nightmare.
[ Parent
| on HN ]
Re:Show HN: Smart pointers for the C programming language
by ANTSANTS on Wednesday January 14, 2015 @01:58PM
(#8888242)
> That said, I've tried making green threads for C and it was a nightmare. I got something working though, so it's possible, but still a nightmare.
By green threads, do you mean coroutines, or something more complicated? Try the libco library, it implements them in under a hundred lines of C + a small bit of assembly per architecture: https://gitorious.org/bsnes/bsnes/source/1a7bc6bb8767d6464e3...