A header-only C++23 library for task-based parallelism using coroutines and std::expected for error handling.
Coros is a header-only C++23 library designed for task-based parallelism using C++20 coroutines. It allows developers to easily write concurrent tasks that execute on a thread pool, with built-in error handling via std::expected. The library simplifies parallel programming by providing a straightforward API to transform sequential functions into parallel coroutine tasks.
C++ developers working on performance-sensitive applications who need to implement concurrent task execution with modern C++ features like coroutines and std::expected.
Coros offers a lightweight, header-only solution with minimal scheduling overhead, combining the power of coroutines for structured concurrency with robust error handling through std::expected, making parallel programming in C++ more accessible and safe.
An easy-to-use and fast library for task-based parallelism, utilizing coroutines.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
As a header-only library, Coros requires no complex build system integration, making it easy to drop into existing C++ projects with minimal setup overhead.
Leverages C++20 coroutines and C++23's std::expected for a type-safe, expressive interface that reduces boilerplate and integrates seamlessly with contemporary C++ codebases.
Benchmarks in the README demonstrate optimized performance for compute-heavy tasks like matrix multiplication, with minimal scheduling overhead thanks to its coroutine-based design.
Uses std::expected to encapsulate both values and exceptions, providing a monadic approach to error management that is safer and more structured than traditional try-catch blocks in concurrent code.
Requires GCC 13+, Clang 17+, and lacks MSVC support, which severely limits adoption in mixed-platform environments or projects tied to older or Microsoft toolchains.
While simplifying parallelism, coroutines introduce subtle complexities like careful management of captures and references, as warned in the README, which can lead to bugs if not handled properly.
As a new library, Coros lacks extensive documentation beyond the README, community-driven examples, and integration with other C++ libraries, making troubleshooting and adoption more challenging compared to established alternatives.