3 ms·
Yes, they're a hack, but this is HACKer News, right? :-) More correctly, though, as Adam pointed out, the switch statement implementation of protothreads is a h
by benhoyt 14y ago
Yes, they're a hack, but this is HACKer News, right? :-) More correctly, though, as Adam pointed out, the switch statement implementation of protothreads is a hack.
However, I'd like to also point out that it's a very useful hack. In the tiny embedded micros I work with, something like CPC would be much too heavy weight. Protothreads take 2 bytes of RAM per "thread", and you can even get that down to 1 byte if you use __COUNTER__ instead of __LINE__. Protothreads also have the huge advantage of working in regular C and C++, meaning standard tools just work.