aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-12-01 23:04:14 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2013-01-08 02:00:59 +0100
commitf9cae832e6f56c6abe89b3bf05d1f176c2a7c913 (patch)
treedd6c7cbfdee74c58b23e538853d7439bfa1f41e6 /src/net.h
parent1d70f4bde8f6adc4df65397f486186a694a74c60 (diff)
Parallelize script verification
* During block verification (when parallelism is requested), script check actions are stored instead of being executed immediately. * After every processed transactions, its signature actions are pushed to a CScriptCheckQueue, which maintains a queue and some synchronization mechanism. * Two or more threads (if enabled) start processing elements from this queue, * When the block connection code is finished processing transactions, it joins the worker pool until the queue is empty. As cs_main is held the entire time, and all verification must be finished before the block continues processing, this does not reach the best possible performance. It is a less drastic change than some more advanced mechanisms (like doing verification out-of-band entirely, and rolling back blocks when a failure is detected). The -par=N flag controls the number of threads (1-16). 0 means auto, and is the default.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index e37953772e..81caf541b0 100644
--- a/src/net.h
+++ b/src/net.h
@@ -82,6 +82,7 @@ enum threadId
THREAD_DUMPADDRESS,
THREAD_RPCHANDLER,
THREAD_IMPORT,
+ THREAD_SCRIPTCHECK,
THREAD_MAX
};