fallshuang
V2EX  ›  Rust

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

  •  
  •   fallshuang · Dec 9, 2023 · 3258 views
    This topic created in 1063 days ago, the information mentioned may be changed or developed.

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

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

    3 replies  •  2023-12-11 10:14:31 +08:00
    786375312123
    786375312123
    Dec 9, 2023
    1
    直接用 async/await 写
    xiaolin97
    xiaolin97
    Dec 9, 2023
    2
    不想折腾直接拥抱 tokio 生态吧
    araraloren
    araraloren
    Dec 11, 2023
    3
    a toy?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1454 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:58 · PVG 06:58 · LAX 14:58 · JFK 17:58
    ♥ Do have faith in what you're doing.