From f9cae832e6f56c6abe89b3bf05d1f176c2a7c913 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 1 Dec 2012 23:04:14 +0100 Subject: 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. --- bitcoin-qt.pro | 1 + 1 file changed, 1 insertion(+) (limited to 'bitcoin-qt.pro') diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 2ca142add6..31780b5b84 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -156,6 +156,7 @@ HEADERS += src/qt/bitcoingui.h \ src/init.h \ src/irc.h \ src/mruset.h \ + src/checkqueue.h \ src/json/json_spirit_writer_template.h \ src/json/json_spirit_writer.h \ src/json/json_spirit_value.h \ -- cgit v1.2.3