{"id":17002121,"url":"https://github.com/sagiegurari/c_thread_pool","last_synced_at":"2025-08-19T05:11:03.960Z","repository":{"id":153634861,"uuid":"629609881","full_name":"sagiegurari/c_thread_pool","owner":"sagiegurari","description":"Thread Pool for C","archived":false,"fork":false,"pushed_at":"2023-09-27T07:12:31.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-03T02:12:33.443Z","etag":null,"topics":["c","thread","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sagiegurari.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","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}},"created_at":"2023-04-18T16:53:58.000Z","updated_at":"2023-08-16T16:33:23.000Z","dependencies_parsed_at":"2024-11-28T18:44:26.333Z","dependency_job_id":"8cf88e62-b5d4-4e0e-9de4-a9fbe4f244af","html_url":"https://github.com/sagiegurari/c_thread_pool","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sagiegurari/c_thread_pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fc_thread_pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fc_thread_pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fc_thread_pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fc_thread_pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagiegurari","download_url":"https://codeload.github.com/sagiegurari/c_thread_pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fc_thread_pool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271103202,"owners_count":24699646,"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-08-19T02:00:09.176Z","response_time":63,"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":["c","thread","thread-pool","threading"],"created_at":"2024-10-14T04:27:06.452Z","updated_at":"2025-08-19T05:11:03.904Z","avatar_url":"https://github.com/sagiegurari.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thread Pool\n\n[![CI](https://github.com/sagiegurari/c_thread_pool/workflows/CI/badge.svg?branch=master)](https://github.com/sagiegurari/c_thread_pool/actions)\n[![Release](https://img.shields.io/github/v/release/sagiegurari/c_thread_pool)](https://github.com/sagiegurari/c_thread_pool/releases)\n[![license](https://img.shields.io/github/license/sagiegurari/c_thread_pool)](https://github.com/sagiegurari/c_thread_pool/blob/master/LICENSE)\n\n\u003e Thread Pool for C.\n\n* [Overview](#overview)\n* [Usage](#usage)\n* [Contributing](.github/CONTRIBUTING.md)\n* [Release History](CHANGELOG.md)\n* [License](#license)\n\n\u003ca name=\"overview\"\u003e\u003c/a\u003e\n## Overview\nThis library provides a simple thread pool and enables running functions in the background.\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\n\n\u003c!-- example source start --\u003e\n```c\n#include \"threadpool.h\"\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n\nstatic void do_in_background(void *);\n\n\nint main()\n{\n  printf(\"Library Examples:\\n\");\n\n  struct ThreadPool *pool = threadpool_new();\n\n  int               loops    = 100;\n  int               parallel = 100;\n  for (int loop = 0; loop \u003c loops; loop++)\n  {\n    for (int index = 0; index \u003c parallel; index++)\n    {\n      char *args = (char *)malloc(sizeof(char) * 100);\n      sprintf(args, \"loop: %d sub loop: %d\", loop, index);\n\n      // invoke function in the background\n      threadpool_invoke(pool, do_in_background, args);\n    }\n\n    // block until all threads finished processing all requests\n    threadpool_block(pool);\n  }\n\n  // Once done, release the pool.\n  // This will block until all threads are done.\n  threadpool_release(pool);\n\n  return(0);\n}\n\n\nstatic void do_in_background(void *args)\n{\n  printf(\"In thread, args: %s\\n\", (char *)args);\n}\n```\n\u003c!-- example source end --\u003e\n\n## Contributing\nSee [contributing guide](.github/CONTRIBUTING.md)\n\n\u003ca name=\"history\"\u003e\u003c/a\u003e\n## Release History\n\nSee [Changelog](CHANGELOG.md)\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n## License\nDeveloped by Sagie Gur-Ari and licensed under the Apache 2 open source license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagiegurari%2Fc_thread_pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagiegurari%2Fc_thread_pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagiegurari%2Fc_thread_pool/lists"}