https://github.com/nysynysy2/threadpool-cpp17
Header Only, Dynamic Adjust, Super-light-weight, C++17
https://github.com/nysynysy2/threadpool-cpp17
cpp header-only lightweight thread-pool threading threadpool
Last synced: about 1 month ago
JSON representation
Header Only, Dynamic Adjust, Super-light-weight, C++17
- Host: GitHub
- URL: https://github.com/nysynysy2/threadpool-cpp17
- Owner: nysynysy2
- Created: 2023-07-29T06:43:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-04T09:42:08.000Z (over 2 years ago)
- Last Synced: 2023-10-05T08:24:45.738Z (over 2 years ago)
- Topics: cpp, header-only, lightweight, thread-pool, threading, threadpool
- Language: C++
- Homepage:
- Size: 51.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Header Only DynamicAdjust LightWeightl Thread Pool (C++17)
```cpp
ThreadPool(size_t thread_count = std::thread::hardware_concurrency(), bool adjust_enabled = true, size_t max_thread = 100, size_t min_thread = 1, size_t manage_duration_ms = 3000)
std::shared_future::type> add_task(Fn func, Args&&... args)
std::shared_future::type> add_task_delay(size_t delay_ms, Fn func, Args&&... args)
void wait()
void stop_and_join()
void stop_and_detach()
void set_adjust_enabled(bool enabled)
void set_max_thread_count(size_t val)
void set_min_thread_count(size_t val)
size_t get_max_thread_count()const
size_t get_min_thread_count()const
size_t get_working_thread_count()const
size_t get_alive_thread_count()const
bool is_adjust_enabled()const
bool is_stopped()const
```