Skip to content
Snippets Groups Projects
Commit 9a072b13 authored by Daniel Müller's avatar Daniel Müller :speech_balloon:
Browse files

Minor fixes

- Fix include error in httpd.hpp.
- Fix threadpool zero workers with 1 core.
parent 54cae8ce
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <unordered_map> #include <unordered_map>
#include <functional> #include <functional>
#include <netinet/in.h>
#include "http_err.hpp" #include "http_err.hpp"
#include "http_request.hpp" #include "http_request.hpp"
#include "http_response.hpp" #include "http_response.hpp"
......
...@@ -21,6 +21,8 @@ Threadpool::Threadpool(int _numberOfWorkers, int _maxQueueBacklog) ...@@ -21,6 +21,8 @@ Threadpool::Threadpool(int _numberOfWorkers, int _maxQueueBacklog)
// is double the amount of physical cores. So on a modern machine with hyperthreading // is double the amount of physical cores. So on a modern machine with hyperthreading
// the number of worker threads will be equivalent to the number of "real" cpu cores // the number of worker threads will be equivalent to the number of "real" cpu cores
numberOfWorkers = std::thread::hardware_concurrency() / 2; numberOfWorkers = std::thread::hardware_concurrency() / 2;
if (numberOfWorkers < 1) numberOfWorkers = 1;
} }
if (maxQueueBacklog != DISABLE_MAX_QUEUE_BACKLOG) if (maxQueueBacklog != DISABLE_MAX_QUEUE_BACKLOG)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment