Skip to content

Commit df97f87

Browse files
committed
feat: determine the number of threads based on the machine
1 parent 9102ecc commit df97f87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
#include <iostream>
1111
#include <utility>
1212
#include <cassert>
13+
#include <thread>
1314

1415
#include <napi.h>
1516

1617
using namespace std;
1718

18-
constexpr auto kMaxThreads = 16u;
19+
static const auto kMaxThreads = std::thread::hardware_concurrency();
1920

2021
#ifdef ENABLE_DEBUG
2122
// TODO does not work anymore because we added explicit to constructors

0 commit comments

Comments
 (0)