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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Lua-Style Coroutines in C++

19 点作者 mfichman大约 14 年前

2 条评论

gorset大约 14 年前
Wouldn't "create", "getcurrent" and "switch" be better primitives for coroutines [0]?<p>Having a concept of caller and callee complicates the maintenance of a large number of "concurrent" coroutines that does different things, and "yield" can be implemented by just using a global variable.<p>[0]: <a href="http://pypy.readthedocs.org/en/latest/stackless.html#coroutines" rel="nofollow">http://pypy.readthedocs.org/en/latest/stackless.html#corouti...</a>
评论 #2513509 未加载
aliguori大约 14 年前
Most C++ implementations throw their hands up at setjmp/longjmp/setcontext/makecontext.<p>Even if it appears to work, it's a dangerous set of routines to use in C++.
评论 #2513679 未加载
评论 #2514107 未加载
评论 #2513606 未加载
评论 #2513609 未加载