TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Co-routines in C

7 点作者 scharan超过 15 年前
Read this article on three different occasions to understand its intent. It finally clicked when I read this:<p>"...co-routines save the control state of a function between calls. Kinda like recursion - you know exactly where are you going to return after a function call...When you call a co-routine, it doesn’t start all over from the beginning. Rather, it starts from right after where it returned (yielded control) the previous time it was called."<p>Source:http://eli.thegreenplace.net/2009/08/29/co-routines-as-an-alternative-to-state-machines/

1 comment

mgreenbe超过 15 年前
A neat trick, but also one of the better arguments for more principled macro systems. These macros are fragile, and the error messages for misuse must be inscrutable. So: cool, but I hope I never have to use it.