Skip to content

Cra3z/coio

Repository files navigation

coio


License: MIT Language Standard

coio is a modern C++20 library that provides asynchronous programming facilities built on std::execution (sender/receiver model, P2300) and C++20 coroutines.

what's sender/receiver?

Features

  • Sender/Receiver model — Composable asynchronous algorithms via std::execution
  • Coroutine typestask<T, Alloc> and generator<Ref, Val> for async computations and lazy sequences
  • Execution contextstime_loop, epoll_context, uring_context with thread-safe run()
  • Networking — TCP/UDP sockets with sync and async operations (Linux)
  • Synchronizationasync_mutex, async_semaphore, async_latch
  • Utilities — Timers, concurrent queues, signal handling

Note

Some network and async-io facilities are currently only implemented using epoll and io_uring on linux.

Build and Install

Requirements

  • C++20 compatible compiler (GCC 10+, Clang 10+, MSVC 2019+)
  • CMake 3.26+

Build Options

  • COIO_BUILD_EXAMPLES (ON/OFF, default OFF) - Build example programs
  • COIO_SENDERS_BACKEND (NVIDIA/BEMAN/CXX26, default NVIDIA) - Which std::execution implementation to use:
    • NVIDIA - NVIDIA/stdexec implementation
    • BEMAN - bemanproject/execution implementation
    • CXX26 - Standard library implementation (C++26+)

Dependencies

Basic Build

cmake -S . -B <build directory>
cmake --build <build directory>

Build with Examples

cmake -S . -B <build directory> -DCOIO_BUILD_EXAMPLES=ON
cmake --build <build directory>

Install

cmake --install <build directory> --prefix <install directory>

CMake Usage

After installation, use in your CMakeLists.txt:

find_package(coio REQUIRED)
target_link_libraries(your_target PRIVATE coio::coio)

Usage & Document

Releases

No releases published

Packages

 
 
 

Contributors

Languages