mbrossard/threadpool
FreeA simple C Thread pool implementation
FreeFree tier
About mbrossard/threadpool
A simple C thread pool implementation using pthreads. The API is intentionally opaque to allow other implementations (e.g., Windows). Threads are started on pool creation, and one task is reserved for signaling queue fullness. Worker threads are stopped and joined on pool destruction. The repository includes source code, tests, and a Makefile, licensed under BSD-2-Clause.
Key Features
Works with pthreads only, with an opaque API for potential other implementations
All threads started on creation of the thread pool
Reserves one task for signaling the queue is full
Stops and joins all worker threads on destroy
BSD-2-Clause license
Includes source code, tests, and Makefile
Pros & Cons
Pros
- Simple and minimalistic implementation, easy to understand and integrate
- BSD-2-Clause license allows free use in proprietary projects
- Active repository with 895 stars and 337 forks indicating community trust
- Open source with full source code available on GitHub
Cons
- Currently only supports pthreads, no native Windows API support
- No dynamic thread resizing (lazy creation or automatic reduction not implemented)
- Unlimited queue size not implemented, queue can become full
- No official releases or versioning published
Best For
Multi-threaded task scheduling in C applications on Unix-like systemsEducational reference for implementing thread poolsLightweight concurrency management in embedded or server applications
FAQ
What is the license for threadpool?
The project is licensed under BSD-2-Clause.
Which platforms does threadpool support?
Currently it works with pthreads, targeting Unix-like systems (Linux, macOS, etc.). Windows support is not implemented but the API is designed to allow it.
Is threadpool production-ready?
It is a simple implementation intended for learning and basic usage. It has no official releases and lacks some features, so production use may require additional testing or enhancements.