bitcoin/bitcoin — pull request #2060 by sipa (2012-12-02 01:13:35+00:00)
Title: Parallel

* 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) process elements from this queue, and, and signal the waiting block verification code when they are done.

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).

This feature is enabled though the -par=N flag.

Depends on #2058 and #2059.