Updated documentation

This commit is contained in:
yhirose 2020-09-15 10:11:46 -04:00
parent 7b55ecdc59
commit aec2f9521d

View File

@ -297,13 +297,18 @@ Please see [Server example](https://github.com/yhirose/cpp-httplib/blob/master/e
### Default thread pool support ### Default thread pool support
`ThreadPool` is used as a **default** task queue, and the default thread count is 8, or `std::thread::hardware_concurrency()`. You can change it with `CPPHTTPLIB_THREAD_POOL_COUNT`.
`ThreadPool` is used as a default task queue, and the default thread count is set to value from `std::thread::hardware_concurrency()`. If you want to set the thread count at runtime, there is no convenient way... But here is how.
You can change the thread count by setting `CPPHTTPLIB_THREAD_POOL_COUNT`. ```cpp
svr.new_task_queue = [] { return new ThreadPool(12); };
```
### Override the default thread pool with yours ### Override the default thread pool with yours
You can supply your own thread pool implementation according to your need.
```cpp ```cpp
class YourThreadPoolTaskQueue : public TaskQueue { class YourThreadPoolTaskQueue : public TaskQueue {
public: public: