V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
cyhone
V2EX  ›  C

云风 coroutine 协程库源码分析

  •  
  •   cyhone · Sep 19, 2019 · 5039 views
    This topic created in 2411 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   ·   4755 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 04:04 · PVG 12:04 · LAX 21:04 · JFK 00:04
    ♥ Do have faith in what you're doing.