Skip to content

Commit f1ec7cf

Browse files
committed
Allow the C++ server to use all cores instead of -1, mostly to let dual-cores perform better
1 parent 24b8f66 commit f1ec7cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/evhtp/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ int main(int argc, char **argv) {
4545
}
4646
else if(num_threads < 0) {
4747
const int cores = std::thread::hardware_concurrency();
48-
if(cores > 0 && cores > -num_threads) {
49-
evhtp_use_threads_wexit(htp, NULL, NULL, cores + num_threads, NULL);
48+
if(cores > 0 && cores > -num_threads + 1) {
49+
evhtp_use_threads_wexit(htp, NULL, NULL, cores + num_threads + 1, NULL);
5050
}
5151
}
5252

0 commit comments

Comments
 (0)