News Score: Score the News, Sort the News, Rewrite the Headlines

Coroutines in C

by Simon Tatham [Coroutines trilogy: C preprocessor | C++20 native | general philosophy ] Introduction Structuring a large program is always a difficult job. One of the particular problems that often comes up is this: if you have a piece of code producing data, and another piece of code consuming it, which should be the caller and which should be the callee? Here is a very simple piece of run-length decompression code, and an equally simple piece of parser code: /* Decompression code */ while (1...

Read more at chiark.greenend.org.uk

© News Score  score the news, sort the news, rewrite the headlines