diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-04 00:22:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-04 00:22:48 +0100 |
| commit | c16a753940f1b03a0c5c268e4132d3f860910dae (patch) | |
| tree | 8e35b8b3b37e09923b548a5b9134174530449c57 /src | |
| parent | b68591911bd8116df0ad987627244b9bdf87de89 (diff) | |
Initialise the number of threads to the number of cores in the machine (#170).
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/config.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 7d8e82335..d2d7fa2fd 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -36,13 +36,14 @@ using std::vector; using std::ifstream; using std::string; using std::ofstream; +using std::max; using boost::shared_ptr; Config* Config::_instance = 0; /** Construct default configuration */ Config::Config () - : _num_local_encoding_threads (2) + : _num_local_encoding_threads (max (2U, boost::thread::hardware_concurrency())) , _server_port (6192) , _reference_scaler (Scaler::from_id (N_("bicubic"))) , _tms_path (N_(".")) |
