mthli / blog

Yet another blog of myself 👀
https://mthli.xyz
MIT License
42 stars 4 forks source link

coroutines-in-c/ #10

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

使用 C 语言实现协程

一种基于达夫设备的思想实现的协程。

https://mthli.xyz/coroutines-in-c/

Drincann commented 2 years ago

好文

fanxing-6 commented 1 year ago

好!

chirsz-ever commented 1 year ago

想直接用的可以用 boost::asio 的 coroutine.hpp,就用的这个方法。

uason7 commented 1 year ago

好文,狠狠收藏了

KKould commented 4 months ago

我的年度最佳

whitestarlau commented 3 months ago

最近在研究这块,南京大学蒋炎岩老师的操作系统课程给了我很大启发,同时他的实验课提到其实C提供了保存现场和恢复现场的方法,也就是setjmp和longjmp。另外提供一个额外的视角,kotlin里面的协程也是靠类似的“设置label”的方式来实现的。