cyhone
V2EX  ›  C

云风 coroutine 协程库源码分析

  •  
  •   cyhone · Sep 19, 2019 · 5092 views
    This topic created in 2433 days ago, the information mentioned may be changed or developed.

    http://www.cyhone.com/articles/analysis-of-cloudwu-coroutine/

    云风实现了一套C 语言的协程库,整体背景可以参考其博客

    这个协程库非常轻量级,一共也才 200 多行代码,使用上更贴近于 lua 的写法(众所周知,云风是知名的 lua 粉)。整体基于 ucontext 和共享栈模型实现了有栈协程,代码质量毋庸置疑,本文将详细剖析该协程库的实现原理。

    同时,我也提供了coroutine 注释版,辅助大家理解 coroutine 的代码。

    点击查看原文

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3349 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 10:43 · PVG 18:43 · LAX 03:43 · JFK 06:43
    ♥ Do have faith in what you're doing.