A C++11 parallel computing and asynchronous networking framework used in Sogou's back-end services, for building DAG-based task workflows.
ChunelFeng/CGraph
A dependency-free C++11 DAG framework for building and running parallel task graphs, with a Python binding (pycgraph).
- Stars
- 2,317
- Forks
- 391
- Open issues
- 13
- Last commit
- 5 days ago
What is it?
CGraph is a cross-platform C++ framework for describing and executing directed acyclic graphs of tasks. You subclass a node class, implement its run() method, and declare dependencies between nodes. The scheduler then runs dependent nodes in order and runs independent nodes concurrently, with support for pause, resume and timeouts.
Beyond plain dependencies, the framework provides groups for conditional branching, loops and concurrent execution, as well as parameter passing, events, messages and aspects for cross-cutting logic. It is written against the C++11 standard library, builds on macOS, Linux, Windows and Android, and is also available as the Python package pycgraph.
The project is aimed at developers who need to orchestrate multi-step processing pipelines in native code, such as algorithm workflows or inference pre- and post-processing, without adding external dependencies.
Key features
- 01Runs dependent nodes in order and independent nodes concurrently
- 02Supports conditional branches, loops and grouped execution
- 03Provides pause, resume and per-node timeout control
- 04Passes parameters, messages and events between nodes
- 05Has no third-party dependencies and builds on C++11 with Python bindings
Use cases
- Orchestrating multi-stage algorithm or data-processing pipelines in C++ applications
- Structuring AI inference pre- and post-processing steps as a dependency graph
- Embedding a task-graph scheduler in embedded or Android projects without external libraries
Quick start
- 1
Install the Python binding from PyPI
pip install pycgraph - 2
Save the README's Python demo as a script and run it with Python
Things to know
- The C++ version has no package-manager install shown in the README and must be built from source using the separate COMPILE.md guide.
- The main README is written in Chinese, with a separate English README linked from it.
In collections
Topics
FAQ
- What is CGraph?
- A dependency-free C++11 DAG framework for building and running parallel task graphs, with a Python binding (pycgraph). CGraph is a cross-platform C++ framework for describing and executing directed acyclic graphs of tasks. You subclass a node class, implement its run() method, and declare dependencies between nodes. The scheduler then runs dependent nodes in order and runs independent nodes concurrently, with support for pause, resume and timeouts.
- Is CGraph free to use? What license does it have?
- CGraph is open source under the MIT license. Check the license terms before using it in commercial products.
- Is CGraph still maintained?
- Actively maintained. The last commit to CGraph was on Nov 3, 2026.
- What can I use CGraph for?
- Orchestrating multi-stage algorithm or data-processing pipelines in C++ applications Structuring AI inference pre- and post-processing steps as a dependency graph Embedding a task-graph scheduler in embedded or Android projects without external libraries
- How do I install CGraph?
- Install the Python binding from PyPI: pip install pycgraph Save the README's Python demo as a script and run it with Python
- Where can I get CGraph?
- The source code and installation instructions are on GitHub: https://github.com/ChunelFeng/CGraph
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Python framework built on luigi for writing machine learning pipelines with automatic caching, reproducibility, and dependency management.
Java distributed job scheduling framework supporting cron, fixed-rate, delayed and MapReduce-style tasks across server and worker nodes.
Open-source TypeScript platform for building and deploying durable, long-running AI agents and background workflows with retries, queues and observability.
Container-native workflow engine for orchestrating parallel jobs on Kubernetes, implemented as a CRD.
Python library for turning data and AI algorithms into production-ready web applications with UI, pipelines and scheduling.