{"id":30618144,"url":"https://github.com/giovanni-iannaccone/cthreadpool","last_synced_at":"2025-08-30T11:09:13.179Z","repository":{"id":308692894,"uuid":"1031312873","full_name":"giovanni-iannaccone/cthreadpool","owner":"giovanni-iannaccone","description":"A header-only thread pool implementation in C 🏊‍♂️","archived":false,"fork":false,"pushed_at":"2025-08-07T09:11:48.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-07T11:21:51.502Z","etag":null,"topics":["c","c-library","multithreading","posix","pthread","thread-pool","threads"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giovanni-iannaccone.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}},"created_at":"2025-08-03T13:32:37.000Z","updated_at":"2025-08-07T09:11:51.000Z","dependencies_parsed_at":"2025-08-07T11:22:32.641Z","dependency_job_id":"1c4ae84d-27ee-4c34-bc44-650d1c2a1efa","html_url":"https://github.com/giovanni-iannaccone/cthreadpool","commit_stats":null,"previous_names":["giovanni-iannaccone/cthreadpool"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/giovanni-iannaccone/cthreadpool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovanni-iannaccone%2Fcthreadpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovanni-iannaccone%2Fcthreadpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovanni-iannaccone%2Fcthreadpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovanni-iannaccone%2Fcthreadpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giovanni-iannaccone","download_url":"https://codeload.github.com/giovanni-iannaccone/cthreadpool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovanni-iannaccone%2Fcthreadpool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272839762,"owners_count":25001877,"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-30T02:00:09.474Z","response_time":77,"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","c-library","multithreading","posix","pthread","thread-pool","threads"],"created_at":"2025-08-30T11:09:11.671Z","updated_at":"2025-08-30T11:09:13.080Z","avatar_url":"https://github.com/giovanni-iannaccone.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏊‍♂️ Thread Pool\n\nThis project implements a lightweight thread pool in C using the POSIX threads (pthread) library. It allows efficient concurrent execution of tasks using a configurable number of threads and a dynamic task queue. Ideal for basic multithreading needs in systems programming and performance-critical applications.\n\n## 🚀 Features\n- Fixed-size or dynamically resizable thread pool\n- Graceful shutdown with support for pending task completion\n- Thread-safe task submission and pool resizing\n\n## 📦 Prerequisites\nThe project assumes a UNIX-like environment (e.g. Linux, macOS).\n\n## 🧮 Installation\n1. First clone the repository\n```\ngit clone https://github.com/giovanni-iannaccone/cthreadpool\n```\n\n2. Include the library in your project\n```c\n#include \"cthreadpool.h\"\n```\n\n## 🛠️ Usage\n- `new_threadpool(n_threads, queue_size)`: Initializes a threadpool with n_threads and a task queue of size queue_size.\n- `submit_task(pool, function, arguments)`: Adds a task to the queue. The task is a function pointer with optional arguments.\n- `destroy_threadpool(pool)`: Safely terminates threads, destroys synchronization primitives, and frees memory.\n\nYou can also resize:\n- `inc_tasksqueue_size(pool, inc)`: Dynamically increases the task queue size.\n- `inc_threadpool_size(pool, inc)`: Adds threads to the pool on-the-fly.\n\n## 🧩 Contributing\nWe welcome contributions! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch ( using \u003ca href=\"https://medium.com/@abhay.pixolo/naming-conventions-for-git-branches-a-cheatsheet-8549feca2534\"\u003ethis\u003c/a\u003e convention).\n3. Make your changes and commit them with descriptive messages.\n4. Push your changes to your fork.\n5. Create a pull request to the main repository.\n\n## ⚖️ License\nThis project is licensed under the GPL-3.0 License. See the LICENSE file for details.\n\n## ⚔️ Contact\n- For any inquiries or support, please contact \u003ca href=\"mailto:iannacconegiovanni444@gmail.com\"\u003e iannacconegiovanni444@gmail.com \u003c/a\u003e.\n- Visit my site for more informations about me and my work \u003ca href=\"https://giovanni-iannaccone.github.io\" target=”_blank” rel=\"noopener noreferrer\"\u003e https://giovanni-iannaccone.github.io \u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiovanni-iannaccone%2Fcthreadpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiovanni-iannaccone%2Fcthreadpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiovanni-iannaccone%2Fcthreadpool/lists"}