Repository Details
Shared by
HelloGitHub Rating
0 ratings
在 C++ 上实现类似 Go goroutine 的库
Past 7 days Received -3 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周二 | 4,229 | — |
| 周三 | 4,229 | 0 |
| 周四 | 4,229 | 0 |
| 周五 | 4,227 | -2 |
| 周六 | 4,226 | -1 |
| 周日 | 4,226 | 0 |
| 周一 | 4,226 | 0 |
4.2k
Stars
Yes
Chinese
C++
Language
Yes
Active
29
Contributors
2
Issues
No
Organization
None
Latest
593
Forks
None
License
它实现了协程同步事件、协程锁、协程池、channel、waitgroup,内存占用少实测 1000 万协程占用 2.8G 内存。
```c++
#include "co/co.h"
DEF_main(argc, argv) {
co::Chan<int> ch;
go([ch]() { /* capture by value, rather than reference */
ch << 7;
});
int v = 0;
ch >> v;
LOG << "v: " << v;
return 0;
}
```
Comments
Rating:
No comments yet