Skip to content

http_listener default thread count - 40 threads #428

Closed
@zerodefect

Description

@zerodefect

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:

  1. The thread count should be configurable via a parameter during intialisation of the http_listener.
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions