Closed
Description
After trying the cpprest library out (on Linux), specifically the http_listener, I have quickly discovered that the default number of threads that are created is 40 threads. Nonetheless, I've examined the code, and I have been unable to ascertain why a value of 40 has been chosen.
A hard-coded thread count is likely to go against a popular school of thought that the number of threads should match the number of CPU cores (or at the most: thread_count <= (2 x cpu cores)). For example, my development system contains 4 cores.
Having thought about this further, there should be two (2) potential changes - the first one is easier than the second:
- The thread count should be configurable via a parameter during intialisation of the http_listener.
- Applicable classes should enable developers to instantiate instances of an object specifying a custom thread pool.
Environment:
Ubuntu Zesty 17.04
Boost 1.62
GCC 6.3
cpprest 2.9
Metadata
Metadata
Assignees
Labels
No labels