exkit is a small C++20 task execution library for dependency-aware workloads. It lets you build a graph of tasks, express dependencies between them, and run the graph on a thread pool so independent tasks can execute in parallel.
Features
- Dependency-aware task scheduling
- Parallel execution on a configurable thread pool
- Support for value-returning and
void tasks
- Exception propagation through task results
- CMake package export with
find_package(exkit) support
Quick Start
Build
Configure the project with the options defined in the root CMake file:
BUILD_TESTING enables or disables the test suite.
MAKE_INSTALLABLE enables or disables install rules.
BUILD_SHARED_LIBS controls whether the library is built shared or static.
cmake -S . -B build -DBUILD_TESTING=ON -DMAKE_INSTALLABLE=ON -DBUILD_SHARED_LIBS=ON
cmake --build build
Test
ctest --test-dir build --output-on-failure
Install
Usage
Create tasks first, then connect dependent tasks, and finally call run():
int main() {
auto fetch = exkit.
task([]() {
return 7; });
auto transform = exkit.
task([](
int value) {
return value + 35; }, fetch);
auto total = exkit.
task([](
int value) {
return value + 378; }, transform);
return total.get() == 420 ? 0 : 1;
}
void run()
Executes all the registered tasks while respecting their dependencies.
auto task(FunctionType &&function)
Creates a new task with the given function.
Definition: exkit.hpp:131
The corresponding pattern in the tests is covered in tests/exkit/task.cpp.
CMake Integration
The exported target name is exkit::exkit.
find_package(exkit REQUIRED)
target_link_libraries(your_target PRIVATE exkit::exkit)
The package config is generated from the files in cmake/Config.cmake.in and installed under the exkit package name.
Project Layout
include/exkit/ Public headers
src/exkit/ Library implementation
tests/ GoogleTest-based test suite
cmake/ Package configuration template
docs/ Doxygen theme assets
Documentation
Doxyfile is included for local API documentation generation with Doxygen.