mthli / blog

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

stackful-stackless/ #13

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

有栈协程与无栈协程

区别在于是否可以在其任意嵌套函数中被挂起。

https://mthli.xyz/stackful-stackless/

SamZhangQingChuan commented 2 years ago

没有太理解为什么无栈协程不能在嵌套函数中yield。只要上下游都async/await就行了吧?

SamZhangQingChuan commented 2 years ago

我大概理解了。感觉本质上没啥区别,有栈协程最终还是要存上下文到堆上的,只不过无栈协程一开始就把所有东西放堆上了。

knull-cn commented 2 years ago

你好,方便直接交流吗?

SamZhangQingChuan commented 2 years ago

微信是qingczha

On Mon, May 9, 2022 at 22:32 knull @.***> wrote:

你好,方便直接交流吗?

— Reply to this email directly, view it on GitHub https://github.com/mthli/blog/issues/13#issuecomment-1121183109, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5HOA6IPPUWWCTZ6UHXRIDVJEOZJANCNFSM5Q3A3VMQ . You are receiving this because you commented.Message ID: @.***>