4 ms·
> 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 th
by 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.