https://github.com/wangbojing/ntyco
纯c版本的协程实现,汇编切换,调度器实现,包含服务器端案例,客户端并发测试案例
https://github.com/wangbojing/ntyco
coroutine tinyhttpd webbench
Last synced: 9 months ago
JSON representation
纯c版本的协程实现,汇编切换,调度器实现,包含服务器端案例,客户端并发测试案例
- Host: GitHub
- URL: https://github.com/wangbojing/ntyco
- Owner: wangbojing
- Created: 2018-07-06T10:05:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-29T08:03:17.000Z (about 1 year ago)
- Last Synced: 2025-04-26T15:41:38.768Z (10 months ago)
- Topics: coroutine, tinyhttpd, webbench
- Language: C
- Homepage:
- Size: 5.35 MB
- Stars: 882
- Watchers: 34
- Forks: 293
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## NtyCo
#### coroutine
[实现原理](https://github.com/wangbojing/NtyCo/wiki/NtyCo%E7%9A%84%E5%AE%9E%E7%8E%B0)
[配套视频讲解](https://it.0voice.com/p/t_pc/goods_pc_detail/goods_detail/course_2QFAeORw45TjJA1y9tq8CmdVJTQ)
## details
#### coroutine FSM

#### storage structure (ready, wait, sleep, status)

#### nty_server process

#### compile
```
编译ntyco的core文件与编译libntyco.a的静态库
$ make
// 编译sample
$ make bin
```
#### err info
```
nty_mysql_oper.c:8:19: fatal error: mysql.h: No such file or directory
解决方案:
# sudo apt-get install libmysqlclient-dev
nty_rediscli.c:11:21: fatal error: hiredis.h: No such file or directory
解决方案:
需要编译安装hiredis: https://github.com/redis/hiredis
```
#### server
```
$ ./bin/nty_server
```
#### client
```
./bin/nty_client
```
#### mul_process, mul_core
```
$ ./bin/nty_server_mulcore
```
#### websocket
```
$ ./bin/nty_websocket_server
```
#### bench
```
$ ./bin/nty_bench
```


#### http server
```
$ ./bin/nty_http_server_mulcore
```

##### [对应视频讲解](https://ke.qq.com/course/2705727?tuin=1bf84273)