3 ms·
Those aren't portable (in particular they don't exist on Windows, and occasionally they exist but are buggy), and "write a pile of assembly" is even less portab
by pm215 12y ago
Those aren't portable (in particular they don't exist on Windows, and occasionally they exist but are buggy), and "write a pile of assembly" is even less portable.
Personally I think the correct conclusion to draw is "C is not a language which supports coroutines" and not try to implement them at all.
- justincormack 12y agoI hear they are buggy on OSX too. It is not a very big pile of assembly though; that is what eg Go does (gccgo uses and requires swapcontext). EDIT: I agree really, C is not very suitable and that is the correct conclusion but if you are eg implementing a language that has them, assembly is the best solution.