{"id":17300808,"url":"https://github.com/wangbojing/ntyco","last_synced_at":"2025-05-14T22:07:23.610Z","repository":{"id":37451365,"uuid":"139968335","full_name":"wangbojing/NtyCo","owner":"wangbojing","description":"纯c版本的协程实现，汇编切换，调度器实现，包含服务器端案例，客户端并发测试案例","archived":false,"fork":false,"pushed_at":"2024-11-29T08:03:17.000Z","size":5613,"stargazers_count":882,"open_issues_count":9,"forks_count":293,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-04-26T15:41:38.768Z","etag":null,"topics":["coroutine","tinyhttpd","webbench"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wangbojing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-06T10:05:59.000Z","updated_at":"2025-04-20T08:20:10.000Z","dependencies_parsed_at":"2022-07-15T21:30:36.192Z","dependency_job_id":"f0af8235-5e6b-4d99-b52d-e18575c78b2d","html_url":"https://github.com/wangbojing/NtyCo","commit_stats":{"total_commits":71,"total_committers":8,"mean_commits":8.875,"dds":"0.46478873239436624","last_synced_commit":"f93ae598283268381ab4c6c478e273a6da51f609"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangbojing%2FNtyCo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangbojing%2FNtyCo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangbojing%2FNtyCo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangbojing%2FNtyCo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangbojing","download_url":"https://codeload.github.com/wangbojing/NtyCo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235696,"owners_count":22036963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coroutine","tinyhttpd","webbench"],"created_at":"2024-10-15T11:30:19.796Z","updated_at":"2025-05-14T22:07:18.548Z","avatar_url":"https://github.com/wangbojing.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## NtyCo\n\n#### coroutine\n[实现原理](https://github.com/wangbojing/NtyCo/wiki/NtyCo%E7%9A%84%E5%AE%9E%E7%8E%B0)\n[配套视频讲解](https://it.0voice.com/p/t_pc/goods_pc_detail/goods_detail/course_2QFAeORw45TjJA1y9tq8CmdVJTQ)\n\n## details\n#### coroutine FSM\n![](http://bojing.wang/wp-content/uploads/2018/08/status_machine.png)\n\n#### storage structure (ready, wait, sleep, status)\n![](http://bojing.wang/wp-content/uploads/2018/08/6.1.png)\n\n#### nty_server process\n![](https://cos.0voice.com/nty_server_uml.png)\n\n#### compile\n\n```\n编译ntyco的core文件与编译libntyco.a的静态库\n$ make\n\n// 编译sample\n$ make bin\n```\n\n#### err info\n```\nnty_mysql_oper.c:8:19: fatal error: mysql.h: No such file or directory\n\n解决方案：\n# sudo apt-get install libmysqlclient-dev\n\nnty_rediscli.c:11:21: fatal error: hiredis.h: No such file or directory\n\n解决方案：\n需要编译安装hiredis: https://github.com/redis/hiredis\n\n```\n\n\n#### server \n```\n$ ./bin/nty_server\n```\n#### client\n```\n./bin/nty_client\n```\n\n#### mul_process, mul_core\n```\n$ ./bin/nty_server_mulcore\n```\n#### websocket\n```\n$ ./bin/nty_websocket_server\n```\n\n#### bench\n```\n$ ./bin/nty_bench\n```\n![](http://bojing.wang/wp-content/uploads/2018/08/nty_bench_ntyco.png)\n![](http://bojing.wang/wp-content/uploads/2018/08/nty_bench_nginx.png)\n\n\n#### http server\n```\n$ ./bin/nty_http_server_mulcore\n```\n\n![](http://bojing.wang/wp-content/uploads/2018/08/ntyco_ab.png)![](http://bojing.wang/wp-content/uploads/2018/08/nginx_ab.png)\n\n##### [对应视频讲解](https://ke.qq.com/course/2705727?tuin=1bf84273)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangbojing%2Fntyco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangbojing%2Fntyco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangbojing%2Fntyco/lists"}