3 ms·
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 wan
by tormeh 12y ago
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.
- ANTSANTS 12y ago> 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/1a7bc6bb8767d6464e3ed7f1887398bfbd62dc3c:libco https://gitorious.org/bsnes/bsnes/source/1a7bc6bb8767d6464e3...
- tormeh 12y agoGreen threads on multiple POSIX threads in portable C. That's when things get complicated.