aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-04-29 10:54:04 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2013-04-29 10:54:04 -0700
commit228b29cf8f9241df7d4b65c53fbfb59247c78861 (patch)
treed9f75f7b3c4963bb838b4bb1e95e3f9db2079935 /src/init.cpp
parent7226806e8db493b15c6a2bd396bd506645e6e8a4 (diff)
parentebd7e8bf917eb18a8d69019cb6d33af08b5c0fc0 (diff)
Merge pull request #2349 from dserrano5/master
Accept negative -par values to leave N CPUs free.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 7024f3f785..c42f1aab03 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -349,7 +349,7 @@ std::string HelpMessage()
" -txindex " + _("Maintain a full transaction index (default: 0)") + "\n" +
" -loadblock=<file> " + _("Imports blocks from external blk000??.dat file") + "\n" +
" -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n" +
- " -par=<n> " + _("Set the number of script verification threads (1-16, 0=auto, default: 0)") + "\n" +
+ " -par=N " + _("Set the number of script verification threads (up to 16, 0=auto, negative=leave N CPUs free, default: 0)") + "\n" +
"\n" + _("Block creation options:") + "\n" +
" -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n" +
@@ -525,8 +525,8 @@ bool AppInit2(boost::thread_group& threadGroup)
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency
nScriptCheckThreads = GetArg("-par", 0);
- if (nScriptCheckThreads == 0)
- nScriptCheckThreads = boost::thread::hardware_concurrency();
+ if (nScriptCheckThreads <= 0)
+ nScriptCheckThreads += boost::thread::hardware_concurrency();
if (nScriptCheckThreads <= 1)
nScriptCheckThreads = 0;
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)