Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用 C 语言实现协程 - Luyu Huang's Blog #86

Open
luyuhuang opened this issue Jun 13, 2024 · 0 comments
Open

用 C 语言实现协程 - Luyu Huang's Blog #86

luyuhuang opened this issue Jun 13, 2024 · 0 comments

Comments

@luyuhuang
Copy link
Owner

https://luyuhuang.tech/2024/06/14/c-coroutine.html

协程与线程(进程)[1]都是模拟多任务(routine)并发执行的软件实现。操作系统线程在一个 CPU 线程中模拟并发执行多个任务,而协程(coroutine)在一个操作系统线程中模拟并发执行多个任务。 因此协程也被称为“用户态线程”、“轻量级线程”。之所以说“模拟并发执行”,是因为任务实际并没有同时运行,而是通过来回切换实现的。 线程切换由操作系统负责,而协程切换通常由程序员直接控制。程序员通

Repository owner deleted a comment from Rakhi696 Oct 24, 2024
Repository owner deleted a comment from jihad12344567 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant