Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Winnerhust/uthread
一个简单的用户级线程库
https://github.com/Winnerhust/uthread
Last synced: 3 months ago
JSON representation
一个简单的用户级线程库
- Host: GitHub
- URL: https://github.com/Winnerhust/uthread
- Owner: Winnerhust
- Created: 2014-12-12T12:47:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-09-29T08:21:28.000Z (about 4 years ago)
- Last Synced: 2024-07-16T13:05:07.329Z (4 months ago)
- Language: C++
- Size: 5.86 KB
- Stars: 341
- Watchers: 25
- Forks: 135
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
uthread
=======一个简单的C++用户级线程(协程)库
* 一个调度器可以拥有多个协程
* 通过`uthread_create`创建一个协程
* 通过`uthread_resume`运行或者恢复运行一个协程
* 通过`uthread_yield`挂起一个协程,并切换到主进程中
* 通过`schedule_finished` 判断调度器中的协程是否全部运行完毕
* 每个协程最多拥有128Kb的栈,增大栈空间需要修改源码的宏`DEFAULT_STACK_SIZE `,并重新编译更详细的介绍,请查看我的中文博客 [人既无名的专栏](http://blog.csdn.net/qq910894904/article/details/41911175).