{"id":19159886,"url":"https://github.com/tzcnt/toomanycooks","last_synced_at":"2026-02-02T05:14:39.147Z","repository":{"id":195482529,"uuid":"686195857","full_name":"tzcnt/TooManyCooks","owner":"tzcnt","description":"C++20 thread pool / tasking library / coroutine runtime with no compromises. Excellent performance, powerful features, and simple syntax.","archived":false,"fork":false,"pushed_at":"2025-10-05T03:33:11.000Z","size":722,"stargazers_count":43,"open_issues_count":20,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-05T04:28:40.174Z","etag":null,"topics":["concurrency","coroutines","cpp","cpp20","lock-free","multi-threading","multithreading","parallel","task-graph","tasking","threadpool","wait-free","work-stealing"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tzcnt.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":"2023-09-02T02:05:24.000Z","updated_at":"2025-10-02T03:09:51.000Z","dependencies_parsed_at":"2024-01-25T04:30:22.336Z","dependency_job_id":"19b709d0-51ba-4d0f-8f2f-d6cffceae091","html_url":"https://github.com/tzcnt/TooManyCooks","commit_stats":null,"previous_names":["tzcnt/toomanycooks"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/tzcnt/TooManyCooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzcnt%2FTooManyCooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzcnt%2FTooManyCooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzcnt%2FTooManyCooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzcnt%2FTooManyCooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tzcnt","download_url":"https://codeload.github.com/tzcnt/TooManyCooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzcnt%2FTooManyCooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001323,"owners_count":26083040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["concurrency","coroutines","cpp","cpp20","lock-free","multi-threading","multithreading","parallel","task-graph","tasking","threadpool","wait-free","work-stealing"],"created_at":"2024-11-09T08:52:42.004Z","updated_at":"2026-02-02T05:14:39.137Z","avatar_url":"https://github.com/tzcnt.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![x64-linux-gcc](https://github.com/tzcnt/TooManyCooks/actions/workflows/x64-linux-gcc.yml/badge.svg) ![x64-linux-clang](https://github.com/tzcnt/TooManyCooks/actions/workflows/x64-linux-clang.yml/badge.svg) ![x64-windows-clang-cl](https://github.com/tzcnt/TooManyCooks/actions/workflows/x64-windows-clang-cl.yml/badge.svg) ![arm64-macos-clang](https://github.com/tzcnt/TooManyCooks/actions/workflows/arm64-macos-clang.yml/badge.svg)\n\n![AddressSanitizer](https://github.com/tzcnt/TooManyCooks/actions/workflows/x64-linux-clang-asan.yml/badge.svg) ![ThreadSanitizer](https://github.com/tzcnt/TooManyCooks/actions/workflows/x64-linux-clang-tsan.yml/badge.svg) ![UndefinedBehaviorSanitizer](https://github.com/tzcnt/TooManyCooks/actions/workflows/x64-linux-clang-ubsan.yml/badge.svg) [![codecov](https://codecov.io/gh/tzcnt/TooManyCooks/graph/badge.svg?token=UJ7XFJ72VK)](https://codecov.io/gh/tzcnt/TooManyCooks)\n\n## TooManyCooks\nTooManyCooks is a runtime and concurrency library for C++20 coroutines. Its goals:\n- be the fastest general-purpose coroutine library available (see the [benchmarks](https://github.com/tzcnt/runtime-benchmarks))\n- clean API with minimal noise\n- extensive feature set\n- simple and clear path to migrate legacy applications\n- simple and clear path to integrate with 3rd-party executors/event loops\n\nIt provides:\n- a blazing fast, lock-free, work-stealing, continuation-stealing thread pool (`ex_cpu`)\n- advanced hardware detection and thread configuration via [hwloc](https://www.open-mpi.org/projects/hwloc/)\n- network I/O, file I/O, and timers support by integration with Asio (via [tmc-asio](https://github.com/tzcnt/tmc-asio))\n- support for multiple task priority levels\n- support for both coroutines and regular functors in most APIs\n- a suite of utility functions for fluently interacting with tasks, awaitables, and executors\n- a suite of async data and control structures\n- a global executor instance so you can submit work from anywhere\n- traits-based extensibility for 3rd party awaitables and executors\n\n### Quick Links\n| :page_facing_up: [Documentation](https://fleetcode.com/oss/tmc/docs) | :bulb: [Examples](https://github.com/tzcnt/tmc-examples) | :chart_with_upwards_trend: [Benchmarks](https://github.com/tzcnt/runtime-benchmarks) | :white_check_mark: [Tests](https://github.com/tzcnt/tmc-examples/tree/main/tests) |\n|---|---|---|---|\n\n### A Brief Example\n```cpp\n// A complete implementation of the parallel recursive fibonacci benchmark\n#define TMC_IMPL\n#include \"tmc/all_headers.hpp\"\n#include \u003ciostream\u003e\n\ntmc::task\u003cint\u003e fib(int n) {\n  if (n \u003c 2) {\n    co_return n;\n  }\n  // Fork 2 child tasks in parallel and await both results.\n  // The return type of a single task would be just `int`.\n  // Here, we retrieve both results together in a `std::tuple\u003cint, int\u003e`.\n  auto [x, y] = co_await tmc::spawn_tuple(fib(n - 1), fib(n - 2));\n  co_return x + y;\n}\n\nint main() {\n  // Manually construct an executor and block on a root task.\n  // `tmc::async_main()` could be used instead to simplify this.\n  tmc::cpu_executor().init();\n\n  // Synchronous (blocking) APIs return a std::future.\n  int result = tmc::post_waitable(tmc::cpu_executor(), fib(30)).get();\n  std::cout \u003c\u003c result \u003c\u003c std::endl;\n}\n```\n\n### Building\nTooManyCooks is a header-only library. Adding it to your project is simple:\n1. Download the library and add `/include` to your include path.\n2. Add `#define TMC_IMPL` and `#include \"tmc/all_headers.hpp\"` to exactly one file in your project.\n\nFor a minimal project template, see [tmc-hello-world](https://github.com/tzcnt/tmc-hello-world).\n\n### Configuration\nTooManyCooks will work out of the box as a header-only library without any configuration.\nHowever, some performance tuning options are available. See the documentation section [Build-Time Options](https://fleetcode.com/oss/tmc/docs/latest/build_flags.html) for more info.\n\n### Roadmap\nSee the [issues tagged \"enhancement\"](https://github.com/tzcnt/TooManyCooks/issues?q=is%3Aissue%20state%3Aopen%20label%3Aenhancement) for future planned work. Please leave a :thumbsup: on any issues that are important to you. I will use this as a way to gauge community interest on what should be developed next.\n\n### Supported Compilers\nAll 3 major compilers are fully supported, but Clang is the recommended compiler, as it has the best coroutine codegen and the most functional HALO implementation.\n\nLinux:\n- Clang 17 or newer\n- GCC 14 or newer\n\nWindows:\n- Clang 17 or newer (via clang-cl.exe)\n- MSVC Build Tools v145 (Visual Studio 2026 Insiders) or newer (older versions are affected by [this bug](https://developercommunity.visualstudio.com/t/Incorrect-code-generation-for-symmetric/1659260?scope=follow\u0026viewtype=all))\n\nMacOS:\n- Apple Clang based on Clang 17 or newer with -fexperimental-library\n\n### Supported Hardware\n- x86 (32- or 64-bit)\n- AArch64\n\nTooManyCooks is regularly tested on the following physical devices:\n- Intel i7 4770K\n- Intel i5 13600K\n- AMD Ryzen 5950X\n- AMD EPYC 7742\n- Apple M2\n- Rockchip RK3588S (in a Khadas Edge2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzcnt%2Ftoomanycooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftzcnt%2Ftoomanycooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzcnt%2Ftoomanycooks/lists"}