Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ message("* * * * * * * * * * * * * * * * * * * * * * * * * * * * *")

cmake_minimum_required(VERSION 3.5.0)

project(CGraph VERSION 3.2.4)
project(CGraph VERSION 3.2.5)

if(NOT DEFINED CMAKE_CXX_STANDARD)
# CGraph榛樿浣跨敤C++11鐗堟湰锛屾帹鑽愪娇鐢–++17鐗堟湰銆傛殏涓嶆敮鎸丆++11浠ヤ笅鐗堟湰
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ int main() {
> <b>Python 鐗堟湰</b>

```python
# pip install pycgraph

import time
from datetime import datetime

Expand Down Expand Up @@ -424,10 +426,11 @@ if __name__ == '__main__':
[2026.05.10 - v3.2.4 - Chunel]
* 浼樺寲 `pycgraph` 鍔熻兘

[2026.08.07 - v3.2.5 - Chunel]
[2026.08.15 - v3.2.5 - Chunel]
* 浼樺寲璋冨害鎬ц兘
* 浼樺寲 `pycgraph` 鍔熻兘
* 鎻愪緵 lite 杩愯妯″紡
* 淇敼 `GSome` 浣跨敤鏂瑰紡

</details>

Expand Down
258 changes: 0 additions & 258 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,261 +195,3 @@ if __name__ == '__main__':
* [pybind11](https://github.com/pybind/pybind11) : Seamless operability between C++11 and Python
* The Python API binding feature of this project is implemented with pybind11
* [Bilibili Video: pybind11 practical implementation - how PyCGraph was built](https://www.bilibili.com/video/BV1ofLdz5EzX) | [Feishu document link](https://ilyryn6yei.feishu.cn/docx/YDfHdU9mfoTlnqxaTkscRob6nGe)


[![Star History Chart](https://star-history.dera.page/svg?repos=ChunelFeng/CGraph&type=Date)](https://star-history.dera.page/#ChunelFeng/CGraph&Date)

------------
<details>
<summary><b>Appendix 1. Version Information</b></summary>

[2021.05.04 - v1.0.0 - Chunel]
* Provide graph execution and support parallel computation of independent nodes

[2021.05.09 - v1.1.0 - Chunel]
* Optimize concurrency during graph execution

[2021.05.18 - v1.1.1 - Chunel]
* Add node `name` and `session` information

[2021.05.23 - v1.2.0 - Chunel]
* Provide single-node loop execution

[2021.05.29 - v1.3.0 - Chunel]
* Provide `cluster` and `region` division and loop execution
* Provide `tutorial` content with multiple usage examples

[2021.06.14 - v1.4.0 - Chunel]
* Provide the `param` passing mechanism
* Provide the `group` feature, with multi-node modules uniformly inheriting from the `group` module
* Add support for Linux

[2021.06.20 - v1.4.1 - Chunel]
* Provide the `condition` feature
* Add support for Windows

[2021.06.24 - v1.5.0 - Chunel]
* Provide the `pipeline` factory creation method
* Update `tutorial` content

[2021.07.07 - v1.5.1 - Chunel]
* Optimize the thread pool and implement task stealing

[2021.07.11 - v1.5.2 - Chunel]
* Optimize the thread pool and implement automatic thread-count adjustment

[2021.07.31 - v1.5.3 - Chunel]
* Optimize the thread pool, implement batch task retrieval, and optimize task stealing

[2021.08.29 - v1.6.0 - Chunel]
* Provide multi-`pipeline` support and optimize underlying logic
* Update `tutorial` content

[2021.09.19 - v1.6.1 - Chunel]
* Provide the `Lru` operator, `Trie` operator, and template node, and optimize underlying logic
* Update `tutorial` content

[2021.09.29 - v1.7.0 - Chunel]
* Provide the `aspect` feature for horizontally extending `node` or `group` capabilities
* Update `tutorial` content

[2021.10.07 - v1.7.1 - Chunel]
* Optimize `aspect` implementation logic, provide aspect parameters, and support batch aspect addition
* Update `tutorial` content

[2021.11.01 - v1.8.0 - Chunel]
* Provide the `adapter` feature and the `singleton` adapter feature
* Optimize `pipeline` execution logic
* Update `tutorial` content

[2021.12.18 - v1.8.1 - Chunel]
* Optimize return-value `CStatus` information

[2022.01.02 - v1.8.2 - Chunel]
* Provide automatic exit on node execution timeout and the `task group` feature
* Provide thread pool configuration parameter setters

[2022.01.23 - v1.8.3 - Chunel]
* Provide the `function` adapter to implement functional programming
* Provide thread-priority scheduling and CPU-binding execution
* Update `tutorial` content

[2022.01.31 - v1.8.4 - Chunel]
* Provide asynchronous execution for `node`

[2022.02.03 - v1.8.5 - Chunel]
* Provide the `daemon` feature for periodically executing tasks outside the graph flow
* Update `tutorial` content

[2022.04.03 - v1.8.6 - Chunel]
* Provide the `DistanceCalculator` operator for computing arbitrary data types and arbitrary distance types
* Update `tutorial` content

[2022.04.05 - v2.0.0 - Chunel]
* Provide the `domain` feature and the `Ann` domain abstraction model, beginning support for specific professional domains
* Provide the hold execution mechanism
* Update `tutorial` content

[2022.05.01 - v2.0.1 - Chunel]
* Optimize the `pipeline` registration mechanism and support custom sequential execution of the init method
* Provide a one-click build script

[2022.05.29 - v2.1.0 - Chunel]
* Provide an `element` parameter writing method
* Provide support for C++14
* Update `tutorial` content

[2022.10.03 - v2.1.1 - Chunel]
* Provide a task-priority mechanism in the thread pool
* Optimize `group` execution logic

[2022.11.03 - v2.2.0 - Chunel]
* Provide the `message` feature, mainly for data transfer between different `pipeline`s
* Update `tutorial` content

[2022.12.24 - v2.2.1 - Chunel]
* Provide the `TemplateNode` feature to optimize parameter passing
* Update `tutorial` content

[2022.12.25 - v2.2.2 - [yeshenyong](https://github.com/yeshenyong)]
* Optimize graph execution logic

[2022.12.30 - v2.2.3 - Chunel]
* Provide `message` publish-subscribe support
* Provide execution engine switching

[2023.01.21 - v2.3.0 - Chunel]
* Provide the `event` feature
* Provide the `CGraph Intro.xmind` file to introduce the overall CGraph logic through a mind map

[2023.01.25 - v2.3.1 - Chunel]
* Provide support for C++11. Thanks to [MirrorYuChen](https://github.com/MirrorYuChen) for the related solution

[2023.02.10 - v2.3.2 - Chunel]
* Optimize the scheduling strategy and provide a scheduling parameter configuration interface
* Provide the English version of readme.md

[2023.02.12 - v2.3.3 - [yeshenyong](https://github.com/yeshenyong), Chunel]
* Provide graphviz visualization for graph display
* Provide parameter chain tracing

[2023.02.22 - v2.3.4 - Chunel]
* Optimize the scheduling mechanism on Windows
* Optimize the `param` mechanism and the `event` mechanism

[2023.03.25 - v2.4.0 - [woodx](https://github.com/woodx9), Chunel]
* Provide a runnable Docker environment and the Dockerfile for building it
* Provide the `pipeline` scheduling resource control mechanism
* Optimize scheduling performance

[2023.05.05 - v2.4.1 - Chunel]
* Provide thread-binding execution
* Provide a method to get the maximum parallelism of a `pipeline`. Thanks to [Hanano-Yuuki](https://github.com/Hanano-Yuuki) for the related solution
* Provide asynchronous `pipeline` execution and exit during execution

[2023.06.17 - v2.4.2 - Chunel]
* Provide the `MultiCondition` feature
* Provide pause and resume execution for `pipeline`

[2023.07.12 - v2.4.3 - Chunel]
* Optimize `CStatus` and add exception location information

[2023.09.05 - v2.5.0 - Chunel]
* Provide the perf feature for `pipeline` performance analysis
* Provide the timeout mechanism for `element`
* Provide the `some` feature to optimize asynchronous execution of `pipeline`

[2023.09.15 - v2.5.1 - Chunel]
* Provide the `fence` feature
* Provide the `coordinator` feature

[2023.11.06 - v2.5.2 - Chunel]
* Optimize the `message` feature, allow configuring how to handle blocked writes, and reduce memory copy count
* Add `example` content with simple implementations for different industries
* Optimize scheduling performance

[2023.11.15 - v2.5.3 - Chunel]
* Provide `proto` definition files
* Add the `mutable` feature and provide dependency registration syntax sugar

[2024.01.05 - v2.5.4 - Chunel]
* Provide `test` content, including performance and functional test cases
* Optimize the `event` mechanism and support asynchronous waiting

[2024.07.18 - v2.6.0 - [PaPaPig-Melody](https://github.com/PaPaPig-Melody), Chunel]
* Provide topological execution for `pipeline`
* Provide a method to determine whether dependencies exist between `element`s
* Provide Bazel build support
* Optimize the perf feature

[2024.09.17 - v2.6.1 - Chunel]
* Provide static execution for `pipeline` and a micro-task mechanism based on static execution
* Provide `pipeline` pruning to remove duplicate dependencies between `element`s
* Provide a method for `element` to remove dependencies
* Optimize the `event` mechanism so asynchronous events can wait for completion
* Release the [CGraph-lite](https://github.com/ChunelFeng/CGraph-lite) project, providing simple DAG construction and parameter passing. Its APIs are fully compatible and can be seamlessly switched to this project

[2024.11.16 - v2.6.2 - Chunel]
* Optimize parameter mutex mechanism and retrieval performance
* Fix abnormal waiting in auxiliary threads
* Update `tutorial` content

[2025.03.16 - v3.0.0 - Chunel]
* Provide the Python version
* Provide the `stage` feature for synchronized running between `element`s
* Update `tutorial` content

[2025.05.04 - v3.1.0 - Chunel]
* Provide the full-featured Python version
* Provide Python and C++ hybrid programming
* Provide Python packaging and support installation with `pip3 install PyCGraph`

[2025.06.15 - v3.1.1 - Chunel]
* Provide C# and Java versions
* Provide the `CODE_OF_CONDUCT.md` document

[2025.09.06 - v3.1.2 - Chunel]
* Provide the Go version
* Optimize the `message` feature
* Optimize the `aspect` feature

[2025.11.08 - v3.2.2 - Chunel]
* Provide local save and load features
* Rename `PyCGraph` to `pycgraph` and support installation with `pip3 install pycgraph`

[2026.03.24 - v3.2.3 - Chunel]
* Optimize the `message` feature
* Optimize stability

[2026.05.10 - v3.2.4 - Chunel]
* Optimize the `pycgraph` feature

</details>

------------
<details>
<summary><b>Appendix 2. Thanks</b></summary>

* Thanks to the [Doocs WeChat official account](https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzIxNjA5ODQ0OQ==&action=getalbum&album_id=1989460124624551937&scene=173&from_msgid=2654703194&from_itemidx=1&count=3&nolastread=1#wechat_redirect) for publishing the related introduction document. Welcome to join the [Doocs open-source community](https://github.com/doocs)
* Thanks to the introduction and recommendation from HelloGithub magazine: [HelloGithub Issue 70](https://github.com/521xueweihan/HelloGitHub/blob/master/content/HelloGitHub70.md)

<p align="center"><img src="https://github.com/ChunelFeng/CGraph/blob/main/doc/image/HelloGithub%20Logo.gif"/></p>

* Thanks to the recommendation from [awesome-cpp](https://github.com/fffaraz/awesome-cpp), we all know, it is the most authoritative recommendation list for cpp project in the world
* Thanks to the recommendation from `Taskflow Group`: [awesome-parallel-computing](https://github.com/taskflow/awesome-parallel-computing), and we always treat [taskflow](https://github.com/taskflow/taskflow) as a role model
* Thanks to the recommendation from [awesome-workflow-engines](https://github.com/meirwah/awesome-workflow-engines)
* Thanks to all developers in [CONTRIBUTORS](https://github.com/ChunelFeng/CGraph/blob/main/CONTRIBUTORS.md) for their contributions to the project
* Thanks to all friends who have provided suggestions and advice for the `CGraph` project. They are not listed one by one here. Everyone is always welcome to join and build together

</details>

------------
<details>
<summary><b>Appendix 3. Contact</b></summary>

* WeChat: ChunelFeng (You are welcome to scan the QR code above and add the author as a friend. Please briefly note your personal information ^_^)
* Email: chunel@foxmail.com
* Source Code: https://github.com/ChunelFeng/CGraph
* Forum: www.chunel.cn

</details>
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pybind11

__PYCGRAPH_NAME__ = "pycgraph"
__PYCGRAPH_VERSION__ = "3.2.4"
__PYCGRAPH_VERSION__ = "3.2.5"
__PYCGRAPH_AUTHOR__ = "Chunel"
__PYCGRAPH_AUTHOR_EMAIL__ = "chunel@foxmail.com"
__PYCGRAPH_DESCRIPTION__ = "CGraph with python api wrapper by pybind11"
Expand Down
19 changes: 12 additions & 7 deletions src/UtilsCtrl/ThreadPool/UThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,22 @@ CVoid UThreadPool::monitor() {

CSize UThreadPool::wakeupAllThread() {
CSize size = 0;
CGRAPH_LOCK_GUARD lock(wakeup_mutex_);
for (auto* pt : primary_threads_) {
if (pt->wakeup()) {
++size;
if (wakeup_mutex_.try_lock()) {
for (auto* pt : primary_threads_) {
if (pt->wakeup()) {
++size;
}
}
wakeup_mutex_.unlock();
}

for (const auto& st : secondary_threads_) {
if (st->wakeup()) {
++size;
if (!secondary_threads_.empty() && st_mutex_.try_lock()) {
for (const auto& st : secondary_threads_) {
if (st->wakeup()) {
++size;
}
}
st_mutex_.unlock();
}

return size;
Expand Down
2 changes: 1 addition & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set_project("CGraph")

-- set project version
set_version("3.2.4")
set_version("3.2.5")

-- set language: c++11
set_languages("c++11")
Expand Down
Loading