This project implements a thread pool in C, providing a flexible and efficient way to manage concurrent tasks.
- Thread Pool Initialization: Initialize a thread pool with a fixed number of threads.
- Task Submission: Submit tasks to the thread pool for execution.
- Task Execution: Tasks are executed concurrently by available threads in the pool.
- Thread Pool Destruction: Cleanly destroy the thread pool when it's no longer needed.
- Thread Status Monitoring: Check the number of threads currently executing tasks.
- Task Completion Synchronization: Wait for all submitted tasks to complete before proceeding.
- Make sure you have a C compiler installed on your Unix/Linux system (e.g., GCC).
- This project relies on POSIX threads (pthread), so it is compatible only with Unix/Linux systems.
- Clone this repository to your local machine.
- Navigate to the project directory.
- Compile the project using your preferred C compiler. For example:
gcc -o test test.c thread_pool.c task_queue.c -D THPOOL_DEBUG -pthread