{"id":31692615,"url":"https://github.com/silkodenis/turboq-cpp-async-engine","last_synced_at":"2026-07-11T09:31:14.442Z","repository":{"id":315387603,"uuid":"1058024323","full_name":"silkodenis/turboq-cpp-async-engine","owner":"silkodenis","description":"C++ library for asynchronous task and timer queues, featuring a thread pool with task priority (QoS) support for parallel execution.","archived":false,"fork":false,"pushed_at":"2025-09-19T09:09:30.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T06:45:40.284Z","etag":null,"topics":["async","chrono","cpp","cross-platform","multithreading","mutex","queue","stl","task","thread","thread-pool","timer"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silkodenis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-16T14:18:00.000Z","updated_at":"2025-09-19T09:09:33.000Z","dependencies_parsed_at":"2025-09-18T10:35:25.545Z","dependency_job_id":"b9bcfb4c-f688-464f-bb73-46354573569a","html_url":"https://github.com/silkodenis/turboq-cpp-async-engine","commit_stats":null,"previous_names":["silkodenis/turboq-async-engine","silkodenis/turboq-cpp-async-engine"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/silkodenis/turboq-cpp-async-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fturboq-cpp-async-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fturboq-cpp-async-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fturboq-cpp-async-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fturboq-cpp-async-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silkodenis","download_url":"https://codeload.github.com/silkodenis/turboq-cpp-async-engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fturboq-cpp-async-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35358880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","chrono","cpp","cross-platform","multithreading","mutex","queue","stl","task","thread","thread-pool","timer"],"created_at":"2025-10-08T14:54:21.527Z","updated_at":"2026-07-11T09:31:14.437Z","avatar_url":"https://github.com/silkodenis.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/silkodenis/turboq-cpp-async-engine.svg)](https://github.com/silkodenis/turboq-cpp-async-engine/blob/main/LICENSE)\n![Linux](https://github.com/silkodenis/turboq-cpp-async-engine/actions/workflows/ci-linux.yml/badge.svg?branch=main)\n![macOS](https://github.com/silkodenis/turboq-cpp-async-engine/actions/workflows/ci-macos.yml/badge.svg?branch=main)\n![Windows](https://github.com/silkodenis/turboq-cpp-async-engine/actions/workflows/ci-windows.yml/badge.svg?branch=main)\n\n# TurboQ\n\nC++ library providing asynchronous task and timer queues. It relies on a fixed-size thread pool, minimizing overhead from thread creation and context switching. This architecture enables efficient scheduling and execution of concurrent and serial workloads. The design is inspired by Apple’s Grand Central Dispatch (GCD) and implemented solely with standard C++ primitives: `std::thread`, `std::mutex`, and `std::condition_variable`.\n\nThe library provides:\n- **ThreadPool** with task priority (QoS) support for parallel execution.\n- **Serial and Concurrent queues** for ordered or asynchronous task execution.\n- **Timers** for delayed or scheduled task execution.\n- Easy integration via **CMake** and optional Git submodule.\n\n## Requirements\n- **Git** \n- **CMake** ≥ 3.20\n- **C++17** compatible compiler (GCC, Clang, MSVC)  \n\n## Using with CMake FetchContent\n\nYou can fetch the library directly in your CMakeLists.txt:\n\n```cmake\ninclude(FetchContent)\n\nFetchContent_Declare(\n  TurboQ\n  GIT_REPOSITORY https://github.com/silkodenis/turboq-cpp-async-engine.git\n  GIT_TAG        main\n)\n\nFetchContent_MakeAvailable(TurboQ)\n\ntarget_link_libraries(MyApp PRIVATE turboq)\n```\n\n## Using as a Git submodule\n\nTo include **TurboQ** in your project as a Git submodule:\n\n```bash\ngit submodule add https://github.com/silkodenis/turboq-cpp-async-engine.git external/TurboQ\ngit submodule update --init --recursive\n```\n\nThen, in your CMakeLists.txt:\n\n```cmake\n# Add TurboQ submodule\nadd_subdirectory(external/TurboQ)\n\n# Link with your target\ntarget_link_libraries(MyApp PRIVATE turboq)\n```\n\n## Manual build\n\n#### 1. Clone repository and initialize submodules\n\n```bash\ngit clone https://github.com/silkodenis/turboq-cpp-async-engine.git\ncd turboq-cpp-async-engine\n\n#  If you plan to build and run tests (-DBUILD_TESTS=ON), initialize submodules as well:\ngit submodule update --init --recursive\n```\n\n#### 2. Configure, build library, and run tests\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake .. -DBUILD_TESTS=ON -DBUILD_SHARED=OFF  \ncmake --build . --parallel\n\n# optional, only if BUILD_TESTS=ON\nctest -V   \n```\n\n#### Configure options:\n\nThe following options can be set when configuring the project:\n\n- `BUILD_TESTS` (default: `ON`) - enables building and running tests (requires Catch2 submodule)\n- `BUILD_SHARED` (default: `OFF`) - build library as shared (ON) or static (OFF)\n\n## Example\n\n```cpp\n#include \u003cTurboQ/turboq.hpp\u003e\n#include \u003ciostream\u003e\n#include \u003cthread\u003e\n#include \u003cchrono\u003e\n#include \u003cmutex\u003e\n\nusing namespace std::chrono_literals;\nusing namespace turboq;\n\nint main() {\n    std::mutex cout_mutex;\n\n    // Concurrent queue (tasks may run in parallel)\n    Queue concurrent(\"concurrent\", Queue::Type::Concurrent, ThreadPool::QoS::Utility);\n\n    for (int i = 1; i \u003c= 5; i++) {\n        concurrent.async([i, \u0026cout_mutex] {\n            std::lock_guard\u003cstd::mutex\u003e lock(cout_mutex);\n            std::cout \u003c\u003c \"Concurrent task \" \u003c\u003c i\n                      \u003c\u003c \" running on thread \"\n                      \u003c\u003c std::this_thread::get_id() \u003c\u003c std::endl;\n            std::this_thread::sleep_for(200ms);\n        });\n    }\n\n    // Serial queue (tasks run one after another)\n    Queue serial(\"serial\", Queue::Type::Serial);\n\n    serial.async([\u0026cout_mutex] {\n        std::lock_guard\u003cstd::mutex\u003e lock(cout_mutex);\n        std::cout \u003c\u003c \"Serial task 1\" \u003c\u003c std::endl;\n    });\n\n    serial.async([\u0026cout_mutex] {\n        std::lock_guard\u003cstd::mutex\u003e lock(cout_mutex);\n        std::cout \u003c\u003c \"Serial task 2\" \u003c\u003c std::endl;\n    });\n\n    // Delayed task (executes after 1 second)\n    concurrent.async_after(1s, [\u0026cout_mutex] {\n        std::lock_guard\u003cstd::mutex\u003e lock(cout_mutex);\n        std::cout \u003c\u003c \"Delayed task executed after 1s\" \u003c\u003c std::endl;\n    });\n\n    // Synchronous task (blocks the current thread until finished)\n    serial.sync([\u0026cout_mutex] {\n        std::lock_guard\u003cstd::mutex\u003e lock(cout_mutex);\n        std::cout \u003c\u003c \"Synchronous task finished\" \u003c\u003c std::endl;\n    });\n\n    // Wait a bit to let all tasks complete\n    std::this_thread::sleep_for(3s);\n}\n```\n\n## License\n\nThis project is licensed under the [Apache License 2.0](https://github.com/silkodenis/turboq-cpp-async-engine/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilkodenis%2Fturboq-cpp-async-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilkodenis%2Fturboq-cpp-async-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilkodenis%2Fturboq-cpp-async-engine/lists"}