Use at least two worker threads

This commit is contained in:
badaix 2019-12-11 09:17:59 +01:00
parent 31e7375ed4
commit 33136df424

View file

@ -271,7 +271,7 @@ int main(int argc, char* argv[])
streamServer->start(); streamServer->start();
if (num_threads < 0) if (num_threads < 0)
num_threads = std::max(1, std::min(4, static_cast<int>(std::thread::hardware_concurrency()))); num_threads = std::max(2, std::min(4, static_cast<int>(std::thread::hardware_concurrency())));
LOG(INFO) << "number of threads: " << num_threads << ", hw threads: " << std::thread::hardware_concurrency() << "\n"; LOG(INFO) << "number of threads: " << num_threads << ", hw threads: " << std::thread::hardware_concurrency() << "\n";
auto sig = install_signal_handler({SIGHUP, SIGTERM, SIGINT}, auto sig = install_signal_handler({SIGHUP, SIGTERM, SIGINT},