Skip to content

Commit aec2f95

Browse files
committed
Updated documentation
1 parent 7b55ecd commit aec2f95

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,18 @@ Please see [Server example](https://github.com/yhirose/cpp-httplib/blob/master/e
297297

298298
### Default thread pool support
299299

300+
`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`.
300301

301-
`ThreadPool` is used as a default task queue, and the default thread count is set to value from `std::thread::hardware_concurrency()`.
302+
If you want to set the thread count at runtime, there is no convenient way... But here is how.
302303

303-
You can change the thread count by setting `CPPHTTPLIB_THREAD_POOL_COUNT`.
304+
```cpp
305+
svr.new_task_queue = [] { return new ThreadPool(12); };
306+
```
304307
305308
### Override the default thread pool with yours
306309
310+
You can supply your own thread pool implementation according to your need.
311+
307312
```cpp
308313
class YourThreadPoolTaskQueue : public TaskQueue {
309314
public:

0 commit comments

Comments
 (0)