A portable C thread pool implementation
This repository provides a minimal thread pool implementation in C. It is designed for simplicity and efficiency, making it suitable as a starting point or reference for integrating multithreading into C projects of mine.
- Lightweight thread pool
- Simple worker and task management
- Written in pure C for portability
- GCC or any standard C compiler
- POSIX threads (pthread)
./compile.sh
-> This compiles and executes the benchmarking operation for an example scenario with 50 tasks ( 10 threads max )
The external and internal library functions can be viewed in the thrd_pl.h
and thrd_pl_int.h
.
bench.c
– Example entry point for running the thread poolthrd_pl.c
– Core thread pool implementationthrd_pl.h
– Internal function declarationsthrd_pl_int.h
– Internal function declarations
Nothing to contribute honestly, it is just me learning and designing.