V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
fallshuang
V2EX  ›  Rust

如何在 rust 里实现一个超级轻量级的协程? (譬如 protothread)

  •  
  •   fallshuang · 141 天前 · 1458 次点击
    这是一个创建于 141 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Protothreads 是个 纯 C 的超轻量级(不可能有比它更轻量的了)协程实现,100 多行代码。

    https://dunkels.com/adam/pt/

    3 条回复    2023-12-11 10:14:31 +08:00
    786375312123
        1
    786375312123  
       141 天前
    直接用 async/await 写
    xiaolin97
        2
    xiaolin97  
       140 天前
    不想折腾直接拥抱 tokio 生态吧
    araraloren
        3
    araraloren  
       138 天前
    a toy?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1191 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 23:34 · PVG 07:34 · LAX 16:34 · JFK 19:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.