# lewissbaker/cppcoro

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/lewissbaker-cppcoro).**

3,818 stars · 501 forks · C++ · mit

## Links

- GitHub: https://github.com/lewissbaker/cppcoro
- awesome-repositories: https://awesome-repositories.com/repository/lewissbaker-cppcoro.md

## Topics

`async` `async-await` `asynchronous-programming` `asyncio` `clang` `coroutines` `coroutines-ts` `cplusplus` `cpp` `linux` `msvc` `windows`

## Description

cppcoro is a C++ coroutine library and concurrency toolkit providing primitives for asynchronous tasks, lazy generators, and non-blocking execution. It functions as an asynchronous I/O framework for managing network sockets and file operations through an event loop.

The library features a work-stealing thread pool for distributing tasks across multiple cores and a set of async generators for producing lazy sequences of values both synchronously and asynchronously. It includes a concurrency toolkit with async mutexes, latches, and shared tasks to coordinate multi-threaded execution.

Its capability surface covers asynchronous control flow, including task definition, result transformation, and concurrent result aggregation. It provides execution context management to control where coroutines start and resume, alongside non-blocking file and network I/O support.

The project includes configuration utilities for managing build toolchains, compiler paths, and installation prefixes.

## Tags

### Programming Languages & Runtimes

- [Coroutines](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/synchronization-primitives/channel-based-concurrency/fiber-based-schedulers/coroutines.md) — Provides a comprehensive library of coroutine primitives for building asynchronous, non-blocking C++ applications. ([source](https://github.com/lewissbaker/cppcoro/blob/master/config.cake))
- [Async Generator Libraries](https://awesome-repositories.com/f/programming-languages-runtimes/async-generator-libraries.md) — Provides a specialized toolkit for producing lazy sequences of values both synchronously and asynchronously.
- [Async Generators](https://awesome-repositories.com/f/programming-languages-runtimes/asynchronous-control-flows/asynchronous-generator-runners/async-generators.md) — Implements asynchronous generators for producing lazy sequences of values using C++ coroutines.
- [Coroutine Scheduler Controls](https://awesome-repositories.com/f/programming-languages-runtimes/coroutine-scheduler-controls.md) — Allows assigning specific schedulers to control where coroutines start and resume after asynchronous operations. ([source](https://github.com/lewissbaker/cppcoro/blob/master/README.md))
- [Lazy Sequences](https://awesome-repositories.com/f/programming-languages-runtimes/deferred-execution/lazy-evaluation/lazy-sequences.md) — Provides generators that produce values on demand without blocking the calling thread.
- [Execution Context Controls](https://awesome-repositories.com/f/programming-languages-runtimes/execution-context-controls.md) — Enables specifying the exact execution context where a paused coroutine should resume its work. ([source](https://github.com/lewissbaker/cppcoro#readme))
- [Synchronization Primitives](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/await-points/synchronization-primitives.md) — Implements async mutexes and latches that suspend coroutines without blocking physical execution threads.
- [Lazy Task Definitions](https://awesome-repositories.com/f/programming-languages-runtimes/lazy-task-definitions.md) — Defines lazy computations that remain paused until they are explicitly awaited for execution. ([source](https://github.com/lewissbaker/cppcoro#readme))
- [All-Completion Synchronization](https://awesome-repositories.com/f/programming-languages-runtimes/all-completion-synchronization.md) — Creates synchronization points that resolve only after all provided asynchronous tasks have finished. ([source](https://github.com/lewissbaker/cppcoro#readme))
- [Mutual Exclusion Locks](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/synchronization-primitives/mutual-exclusion-locks.md) — Provides asynchronous mutual exclusion locks that suspend the calling coroutine instead of blocking the thread. ([source](https://github.com/lewissbaker/cppcoro#readme))
- [Task State Management](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtimes/asynchronous-execution-engines/asynchronous-control-flows/promise-based-flow-control/promise-based-chains/task-state-management.md) — Manages the state and results of asynchronous computations through promise objects to coordinate resumption.
- [Synchronous Generators](https://awesome-repositories.com/f/programming-languages-runtimes/synchronous-generators.md) — The project produces a sequence of values lazily and synchronously using a generator that yields values without suspending. ([source](https://github.com/lewissbaker/cppcoro#readme))

### Web Development

- [C++ Coroutine Primitives](https://awesome-repositories.com/f/web-development/server-side-frameworks/kotlin-frameworks/coroutine-frameworks/c-coroutine-primitives.md) — Provides a comprehensive framework based on C++20 specifications for low-level awaitables and lazy execution.

### Data & Databases

- [Asynchronous Sequence Generators](https://awesome-repositories.com/f/data-databases/spreadsheet-generators/asynchronous-generators/asynchronous-sequence-generators.md) — Produces sequences of values lazily where each individual element is generated using asynchronous operations. ([source](https://github.com/lewissbaker/cppcoro#readme))

### Development Tools & Productivity

- [Async Coordination Primitives](https://awesome-repositories.com/f/development-tools-productivity/thread-managers/execution-thread-coordinators/concurrent-task-groups/async-coordination-primitives.md) — Ships a concurrency toolkit with async mutexes and latches to coordinate multi-threaded execution.
- [Thread Pool Context Propagators](https://awesome-repositories.com/f/development-tools-productivity/task-schedulers/context-propagation/thread-pool-context-propagators.md) — Tracks execution environments to ensure coroutines resume on the appropriate scheduler or thread pool.
- [Work-Stealing Thread Pools](https://awesome-repositories.com/f/development-tools-productivity/task-schedulers/context-propagation/work-stealing-thread-pools.md) — Implements a work-stealing thread pool to balance asynchronous task distribution across multiple CPU cores. ([source](https://github.com/lewissbaker/cppcoro#readme))

### Operating Systems & Systems Programming

- [Async Concurrency Toolkits](https://awesome-repositories.com/f/operating-systems-systems-programming/async-concurrency-toolkits.md) — Provides a collection of async mutexes, latches, and shared tasks to coordinate multi-threaded execution.
- [Asynchronous I/O Libraries](https://awesome-repositories.com/f/operating-systems-systems-programming/asynchronous-i-o-libraries.md) — Functions as a non-blocking I/O framework for managing network and file operations via an event loop.
- [Work-Stealing Schedulers](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/runtime-schedulers/work-stealing-schedulers.md) — Employs a work-stealing scheduler to dynamically balance computational tasks across hardware threads.

### Software Engineering & Architecture

- [I/O Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-event-dispatchers/reactive-event-dispatchers/i-o-event-dispatchers.md) — Monitors asynchronous I/O events via an event loop to trigger the resumption of suspended coroutines.
- [Asynchronous Task Execution](https://awesome-repositories.com/f/software-engineering-architecture/concurrency-models/asynchronous-task-execution.md) — Executes lazy computations that return a result or throw an exception upon being awaited. ([source](https://github.com/lewissbaker/cppcoro/blob/master/README.md))
- [Asynchronous Event Notification Libraries](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-event-dispatchers/asynchronous-event-notification-libraries.md) — Provides event primitives to signal the resumption of suspended asynchronous operations. ([source](https://github.com/lewissbaker/cppcoro#readme))
- [Awaitable Transformations](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/result-transformations/awaitable-transformations.md) — Applies functions to asynchronous results to produce new tasks with transformed values. ([source](https://github.com/lewissbaker/cppcoro#readme))
- [Asynchronous File I/O](https://awesome-repositories.com/f/software-engineering-architecture/non-blocking-io-architectures/asynchronous-file-i-o.md) — Provides non-blocking interfaces for performing read and write operations on the file system.
- [Asynchronous Operation Cancellation](https://awesome-repositories.com/f/software-engineering-architecture/rpc-cancellation/asynchronous-operation-cancellation.md) — Provides token-based polling and callback mechanisms to signal the premature termination of asynchronous operations.
- [Shared Asynchronous Results](https://awesome-repositories.com/f/software-engineering-architecture/shared-asynchronous-results.md) — Allows multiple callers to await the same asynchronous result and resume all of them upon completion. ([source](https://github.com/lewissbaker/cppcoro#readme))
- [Task Result Aggregation](https://awesome-repositories.com/f/software-engineering-architecture/task-result-aggregation.md) — Executes multiple asynchronous operations simultaneously and aggregates their results into a single collection. ([source](https://github.com/lewissbaker/cppcoro/blob/master/README.md))

### System Administration & Monitoring

- [Event-Driven I/O](https://awesome-repositories.com/f/system-administration-monitoring/administrative-operations/linux-system-administration/networking/connection-lifecycle-management/parallel-network-i-o/event-driven-i-o.md) — Uses an event-loop based dispatch system to resume suspended coroutines upon I/O completion. ([source](https://github.com/lewissbaker/cppcoro#readme))
- [Asynchronous Network Programming](https://awesome-repositories.com/f/system-administration-monitoring/administrative-operations/linux-system-administration/networking/connection-lifecycle-management/parallel-network-i-o/event-driven-i-o/asynchronous-network-programming.md) — Provides non-blocking TCP and UDP socket operations using event-driven I/O for high-concurrency network programming.

### DevOps & Infrastructure

- [Async Latches](https://awesome-repositories.com/f/devops-infrastructure/distributed-synchronization/barrier-synchronization/asynchronous-operation-synchronizations/async-latches.md) — Implements asynchronous latches that suspend operations until a counter reaches zero. ([source](https://github.com/lewissbaker/cppcoro#readme))

### Networking & Communication

- [Asynchronous Socket Libraries](https://awesome-repositories.com/f/networking-communication/asynchronous-socket-libraries.md) — Provides asynchronous TCP and UDP socket implementations for non-blocking network communication. ([source](https://github.com/lewissbaker/cppcoro#readme))
