3 ms·
Isn't this just an application of a protothread[1]? There are implementations that use the GCC goto and label pointer, which then avoid the need for a switch s
by mcwoods 8y ago
Isn't this just an application of a protothread[1]?
There are implementations that use the GCC goto and label pointer, which then avoid the need for a switch statement.
[1] http://dunkels.com/adam/pt/ http://dunkels.com/adam/pt/
- srean 8y agoAnswered here https://news.ycombinator.com/item?id=19109008 https://news.ycombinator.com/item?id=19109008 by VygmraMGVl In lining the answer. > Protothreads is a library implementation of this trick. In fact, the protothreads creator even references the linked site in their explanation of protothreads (very last paragraph)
- boomlinde 8y agoRather, the protothreads library is an application of this style of coroutine.