https://github.com/bmoscon/threadpool
Thread Pool Manager in C++
https://github.com/bmoscon/threadpool
Last synced: 5 months ago
JSON representation
Thread Pool Manager in C++
- Host: GitHub
- URL: https://github.com/bmoscon/threadpool
- Owner: bmoscon
- License: other
- Created: 2013-01-24T15:02:50.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-02-06T00:26:15.000Z (almost 10 years ago)
- Last Synced: 2024-10-10T19:12:35.097Z (about 1 year ago)
- Language: C++
- Size: 19.5 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Thread Pool
[](LICENSE)
A simple, but functional thread pool
## Example usage:
You add work/tasks to the thread pool like so:
```
p.add_work(function_pointer);
```
and you start the processing with start:
```
p.start();
```
you can add tasks at any time, and you can stop at any time:
```
p.stop();
```
Stop will be called automatically when the thread pool is destroyed. Stop and the destructor will wait for the threads to complete before exiting.
Thread Pool defaults the worker count to the number of CPUs available on the machine, or you can specify a worker count when constructed.