{"id":19329871,"url":"https://github.com/zhongruoyu/threadpp","last_synced_at":"2025-10-09T21:35:49.103Z","repository":{"id":41802930,"uuid":"424691690","full_name":"ZhongRuoyu/threadpp","owner":"ZhongRuoyu","description":"A lightweight thread pool in C++17.","archived":false,"fork":false,"pushed_at":"2022-07-10T02:37:46.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-30T19:18:26.835Z","etag":null,"topics":["cpp","cpp17","thread-pool","threading"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZhongRuoyu.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}},"created_at":"2021-11-04T18:01:41.000Z","updated_at":"2022-08-07T05:13:20.000Z","dependencies_parsed_at":"2022-09-07T17:40:26.990Z","dependency_job_id":null,"html_url":"https://github.com/ZhongRuoyu/threadpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZhongRuoyu/threadpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZhongRuoyu%2Fthreadpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZhongRuoyu%2Fthreadpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZhongRuoyu%2Fthreadpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZhongRuoyu%2Fthreadpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZhongRuoyu","download_url":"https://codeload.github.com/ZhongRuoyu/threadpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZhongRuoyu%2Fthreadpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002051,"owners_count":26083286,"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":["cpp","cpp17","thread-pool","threading"],"created_at":"2024-11-10T02:31:34.174Z","updated_at":"2025-10-09T21:35:49.084Z","avatar_url":"https://github.com/ZhongRuoyu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# threadpp\n\nthreadpp is a lightweight thread pool implementation in C++17 which provides\na task submission interface compatible with `std::thread`'s\n[constructor](https://en.cppreference.com/w/cpp/thread/thread/thread).\nTasks are submitted and processed on a first-come, first-served basis, and\ntheir results can be obtained via the `std::future` returned from submission.\n\n## How to Use\n\nTo use threadpp in your project, you may either copy the sources under\ndirectories [include](include) and [src](src) to your project, or build it as\na library and link it to your project. To build threadpp, read section \"How to\nBuild\".\n\nBelow is a simple usage example.\n\n```c++\n#include \u003ciostream\u003e\n#include \u003cthread_pool.h\u003e\n\nint FortyTwo() { return 42; }\n\nvoid Foo() {\n    ;  // some task\n}\n\nint main() {\n    // create a ThreadPool with 3 workers\n    threadpp::ThreadPool pool(3);\n\n    // submit tasks\n    std::future\u003cint\u003e forty_two = pool.Add(FortyTwo);\n    std::future\u003cvoid\u003e foo = pool.Add(Foo);\n    std::future\u003cbool\u003e seven_is_even =\n        pool.Add([](int x) { return x % 2 == 0; }, 7);\n\n    // get results as needed\n    std::cout \u003c\u003c forty_two.get() \u003c\u003c std::endl;\n\n    // or simply left out the futures and wait for all tasks to finish\n    pool.Join();\n}\n```\n\nMore examples are available under the [examples](examples) directory.\n\n## How to Build\n\nTo build threadpp, simply run `make`. The compiled library file\n`libthreadpp.a` will then be created.\n\n## License\n\nCopyright (c) 2021 - 2022 Zhong Ruoyu. Licensed under\n[the MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhongruoyu%2Fthreadpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhongruoyu%2Fthreadpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhongruoyu%2Fthreadpp/lists"}