C++20 coroutine based async framework (C++23 needed).
#include <print>
#include <asco/future.h>
using asco::future, asco::future_spawn;
future<int> non_spawn_foo() {
co_return 42;
}
future_spawn<void> spawn_bar() {
std::println("Calling spawn coroutine");
return;
}
future<int> async_main() {
std::println("Hello, World!", co_await non_spawn_foo());
co_await spawn_bar();
co_return 0;
}- Clone one of this repository's version tag.
- Use with cmake:
- Static link:
add_subdirectory(<path-to-this-repo>)
target_link_libraries(<your-target> PRIVATE asco::core asco::main)- Dynamic link:
add_subdirectory(<path-to-this-repo>)
target_link_libraries(<your-target> PRIVATE asco::shared::core asco::shared::main)- How to import
include(FetchContent)
FetchContent_Declare(
asco
GIT_REPOSITORY https://github.com/pointertobios/asco.git
GIT_TAG <version-tag>
)
FetchContent_MakeAvailable(asco)
- Static link:
target_link_libraries(<your-target> PRIVATE asco::core asco::main)- Dynamic link:
target_link_libraries(<your-target> PRIVATE asco::shared::core asco::shared::main)- Basic async runtime
- Platform support
- Linux full support
- Windows full support
- MacOS full support
- Runtime core
- Worker thread pool
- Task scheduling
- Task stealing
- Timers
- High resolution timer
- Timer wheel
- Cancellation with context
- IO
- io_uring (Linux)
- Epoll (Linux)
- IOCP (Windows)
- Kqueue (MacOS) (Wait please)
- Platform support
- Basic tools for concurrent programming
- Sync Primitives
- Spin
- Semaphore
- Channel
- Mutex
- Read-Write Lock
- Condition variable
- Barrier
- Latch
- Sleep and Interval
- Join set
- Select
- Sync Primitives
- Async IO
- Async file IO
- Async TCP/UDP stream
- Buffered IO
- No lock data structures and parallel algorithms
- continuous_queue
- ring_queue
- More to come...
- Clang: Fully supported.
- GCC: Not complete.
- MSVC: Not supported.
See CONTRIBUTING.md for details.
This project is licensed under the MIT License.
Copyright (C) 2025 pointer-to-bios pointer-to-bios@outlook.com
For full legal terms, see the LICENSE file.