https://github.com/pointertobios/asco
Coroutine based async framework.
https://github.com/pointertobios/asco
async async-framework async-programming coroutine coroutines cpp20 cpp23
Last synced: 6 days ago
JSON representation
Coroutine based async framework.
- Host: GitHub
- URL: https://github.com/pointertobios/asco
- Owner: pointertobios
- License: mit
- Created: 2025-04-08T13:48:27.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2026-03-06T09:54:18.000Z (9 days ago)
- Last Synced: 2026-03-06T09:57:08.782Z (9 days ago)
- Topics: async, async-framework, async-programming, coroutine, coroutines, cpp20, cpp23
- Language: C++
- Homepage:
- Size: 572 KB
- Stars: 28
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ASCO
[](LICENSE.md)
基于 C++20 coroutine 的异步框架 (需要 ***C++23*** 支持).
## 开始使用
### 快速开始
依赖目标 `asco::main`:
```cpp
#include
#include
using namespace asco;
future foo() {
std::println("foo() called");
co_return;
}
future async_main() { // asco::main 提供的入口
auto f = foo();
std::println("async_main() running");
co_await f;
std::println("foo() completed");
co_return 0;
}
```
### 文档
- [简体中文](https://pointertobios.github.io/asco/zhcn/)
- [English (Generated by LLM)](https://pointertobios.github.io/asco/enus/)
### 导入到你的项目
#### 作为 Git 子模块
1. 将本仓库添加为 Git 子模块
2. 用 cmake 导入:
- 静态链接:
```cmake
add_subdirectory()
target_link_libraries( PRIVATE asco::core asco::main)
```
- 动态链接:
```cmake
add_subdirectory()
target_link_libraries( PRIVATE asco::shared::core asco::shared::main)
```
#### 用 cmake FetchContent_Declare() 导入
```cmake
include(FetchContent)
FetchContent_Declare(
asco
GIT_REPOSITORY https://github.com/pointertobios/asco.git
GIT_TAG
)
FetchContent_MakeAvailable(asco)
```
## 功能特性
> 非叶子项打 ✔ 表示特性已可用但可能不完整
- [x] 异步运行时
- [x] Linux 完整支持
- [ ] Windows 完整支持
- [ ] MacOS 完整支持
- [x] 核心运行时
- [x] 线程池 runtime
- [x] 任务取消机制
- [x] 动态优先级
- [x] 异步任务本地存储
- [ ] 任务偷窃
- [ ] 计时器
- [ ] 高分辨率计时器
- [ ] 时间轮
- [ ] IO 兼容层
- [ ] io_uring (Linux)
- [ ] Epoll (Linux)
- [ ] IOCP (Windows)
- [x] 测试框架
- [ ] 并发
- [x] 同步原语
- [x] 自旋锁
- [x] 信号量
- [x] 任务取消支持
- [x] 通道
- [ ] 任务取消支持
- [x] 互斥锁
- [ ] 任务取消支持
- [ ] 读写锁
- [ ] 任务取消支持
- [ ] 条件变量
- [ ] 任务取消支持
- [ ] 屏障
- [ ] 任务取消支持
- [ ] 门闩
- [ ] 任务取消支持
- [ ] 定时器与超时
- [ ] 任务取消支持
- [x] 无锁数据结构与算法
- [x] 环形队列
- [ ] 双端队列
- [ ] 异步 IO
- [ ] 文件
- [ ] 网络
- [ ] 远程过程调用(RPC)
## 编译器支持
- Clang: 完整支持
- GCC: 不完全支持
- MSVC: 仅支持 VS 2026 及以上版本的 clang 模式
## 开发与贡献
阅读 [CONTRIBUTING.md](./CONTRIBUTING.md) 了解详情。
## License
本项目使用 **MIT License** 发布.
Copyright (C) 2025 pointer-to-bios
完整的法律条款参见 [LICENSE](./LICENSE.md)。