diff options
author | Jack Lloyd <[email protected]> | 2019-09-14 17:57:00 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-09-14 17:57:00 -0400 |
commit | 7c3122ec4275630d78fbdcb03882b7e1fee45c81 (patch) | |
tree | 02d28f49f557198af187ee1300e199179541220c | |
parent | cb55fadda1d481448d8edf423fc2879d02f9816f (diff) | |
parent | 3d3b7f1d0f8f957924496b35cebcc657647e10f1 (diff) |
Merge GH #2105 Use more accurate core count estimate for thread workers
-rw-r--r-- | src/cli/tls_http_server.cpp | 3 | ||||
-rw-r--r-- | src/cli/tls_proxy.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/cli/tls_http_server.cpp b/src/cli/tls_http_server.cpp index b6961b9df..ca07fba17 100644 --- a/src/cli/tls_http_server.cpp +++ b/src/cli/tls_http_server.cpp @@ -22,6 +22,7 @@ #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> +#include <botan/internal/os_utils.h> #include <botan/tls_server.h> #include <botan/tls_messages.h> @@ -513,7 +514,7 @@ class TLS_HTTP_Server final : public Command { if(size_t t = get_arg_sz("threads")) return t; - if(size_t t = std::thread::hardware_concurrency()) + if(size_t t = Botan::OS::get_cpu_available()) return t; return 2; } diff --git a/src/cli/tls_proxy.cpp b/src/cli/tls_proxy.cpp index d7cc7da68..b0e1b3686 100644 --- a/src/cli/tls_proxy.cpp +++ b/src/cli/tls_proxy.cpp @@ -21,6 +21,7 @@ #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> +#include <botan/internal/os_utils.h> #include <botan/tls_server.h> #include <botan/x509cert.h> @@ -458,7 +459,7 @@ class TLS_Proxy final : public Command { if(size_t t = get_arg_sz("threads")) return t; - if(size_t t = std::thread::hardware_concurrency()) + if(size_t t = Botan::OS::get_cpu_available()) return t; return 2; } |