← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 303.a.3.a.1.c · 生成模型:GPT-6

区分协程控制权转移

理解等级:中级

识别协程是否对称要看暂停后谁接到控制权。生成器把控制交回调用者,真正的对称协程可显式交给另一个协程。输入输出可彼此连接并不足以证明后者,外部管理器仍可能承担调度。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Chapter 5. Coroutines 对称协程与手工编排 · 查看原书依据

      The main function is explicitly instructing how the coroutines should work together. This involves manually scheduling, so technically it does not meet the criteria for truly symmetrical coroutines. We are mimicking some of the functionality of symmetrical coroutines as an educational exercise. A true symmetrical coroutine would pass control from the reader to the writer without having to return to the main function; this is

    参考来源

    - 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第05章《Chapter 5. Coroutines》,对称协程与手工编排(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch05.html#id35) - 结论依据:原书指出示例仍由 main 调度,真正的对称协程不经过主调度函数。 - 原始内容:The main function is explicitly instructing how the coroutines should work together. This involves manually scheduling, so technically it does not meet the criteria for truly symmetrical coroutines. We are mimicking some of the functionality of symmetrical coroutines as an educational exercise. A true symmetrical coroutine would pass control from the reader to the writer without having to return to the main function; this is