From d9e766a7c5e7011b294cb7bf65ca979e87c6e0b7 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 16 Aug 2023 18:39:24 +0700 Subject: [PATCH] Merge #18645: [doc] Update thread information in developer docs 808ef36b89ea9ce72116bbd7ee479b984367dc60 [doc] Update thread information in developer docs (John Newbery) Pull request description: - DumpAddresses thread was removed in #5964 - Shutdown thread was removed in #5679 - Add new threads (scheduler, RPC worker, indexer, tor control) - Small changes to documentation of other threads ACKs for top commit: MarcoFalke: ACK 808ef36b89 hebasto: ACK 808ef36b89ea9ce72116bbd7ee479b984367dc60. Tree-SHA512: 85b6ace7bcc4dee030c63461bef1ded1a9581d4fa249c59f6fcd5d33d89c4357a6b8b35888ce0960f276d397b5e38a21e6c5d4b7b79544827a28c950e097b36d --- doc/developer-notes.md | 56 +++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/doc/developer-notes.md b/doc/developer-notes.md index d48b8ec68a..413ff7199d 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -483,33 +483,61 @@ and its `cs_KeyStore` lock for example). Threads ------- -- ThreadScriptCheck : Verifies block scripts. +- [Main thread (`dashd`)](https://doxygen.bitcoincore.org/bitcoind_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97) + : Started from `main()` in `bitcoind.cpp`. Responsible for starting up and + shutting down the application. -- ThreadImport : Loads blocks from `blk*.dat` files or `-loadblock=`. +- [ThreadImport (`d-loadblk`)](https://doxygen.bitcoincore.org/init_8cpp.html#ae9e290a0e829ec0198518de2eda579d1) + : Loads blocks from `blk*.dat` files or `-loadblock=` on startup. -- ThreadDNSAddressSeed : Loads addresses of peers from the DNS. +- [ThreadScriptCheck (`d-scriptch.x`)](https://doxygen.bitcoincore.org/validation_8cpp.html#a925a33e7952a157922b0bbb8dab29a20) + : Parallel script validation threads for transactions in blocks. -- ThreadMapPort : Universal plug-and-play startup/shutdown. +- [ThreadHTTP (`d-http`)](https://doxygen.bitcoincore.org/httpserver_8cpp.html#abb9f6ea8819672bd9a62d3695070709c) + : Libevent thread to listen for RPC and REST connections. -- ThreadSocketHandler : Sends/Receives data from peers on port 9999. +- [HTTP worker threads(`d-httpworker.x`)](https://doxygen.bitcoincore.org/httpserver_8cpp.html#aa6a7bc27265043bc0193220c5ae3a55f) + : Threads to service RPC and REST requests. -- ThreadOpenAddedConnections : Opens network connections to added nodes. +- [Indexer threads (`d-txindex`, etc)](https://doxygen.bitcoincore.org/class_base_index.html#a96a7407421fbf877509248bbe64f8d87) + : One thread per indexer. -- ThreadOpenConnections : Initiates new connections to peers. +- [SchedulerThread (`d-scheduler`)](https://doxygen.bitcoincore.org/class_c_scheduler.html#a14d2800815da93577858ea078aed1fba) + : Does asynchronous background tasks like dumping wallet contents, dumping + addrman and running asynchronous validationinterface callbacks. -- ThreadOpenMasternodeConnections : Opens network connections to masternodes. +- [TorControlThread (`d-torcontrol`)](https://doxygen.bitcoincore.org/torcontrol_8cpp.html#a4faed3692d57a0d7bdbecf3b37f72de0) + : Libevent thread for tor connections. -- ThreadMessageHandler : Higher-level message handling (sending and receiving). +- Net threads: -- DumpAddresses : Dumps IP addresses of nodes to `peers.dat`. + - [ThreadMessageHandler (`d-msghand`)](https://doxygen.bitcoincore.org/class_c_connman.html#aacdbb7148575a31bb33bc345e2bf22a9) + : Application level message handling (sending and receiving). Almost + all net_processing and validation logic runs on this thread. -- ThreadRPCServer : Remote procedure call handler, listens on port 9998 for connections and services them. + - [ThreadDNSAddressSeed (`d-dnsseed`)](https://doxygen.bitcoincore.org/class_c_connman.html#aa7c6970ed98a4a7bafbc071d24897d13) + : Loads addresses of peers from the DNS. -- Shutdown : Does an orderly shutdown of everything. + - [ThreadMapPort (`d-upnp`)](https://doxygen.bitcoincore.org/net_8cpp.html#a63f82a71c4169290c2db1651a9bbe249) + : Universal plug-and-play startup/shutdown. -- CSigSharesManager::WorkThreadMain : Processes pending BLS signature shares. + - [ThreadSocketHandler (`d-net`)](https://doxygen.bitcoincore.org/class_c_connman.html#a765597cbfe99c083d8fa3d61bb464e34) + : Sends/Receives data from peers on port 9999. -- CInstantSendManager::WorkThreadMain : Processes pending InstantSend locks. + - [ThreadOpenAddedConnections (`d-addcon`)](https://doxygen.bitcoincore.org/class_c_connman.html#a0b787caf95e52a346a2b31a580d60a62) + : Opens network connections to added nodes. + + - [ThreadOpenConnections (`d-opencon`)](https://doxygen.bitcoincore.org/class_c_connman.html#a55e9feafc3bab78e5c9d408c207faa45) + : Initiates new connections to peers. + + - ThreadOpenMasternodeConnections (`d-mncon`) + : Opens network connections to masternodes. + + - CSigSharesManager::WorkThreadMain (`d-sigshares`) + : Processes pending BLS signature shares. + + - CInstantSendManager::WorkThreadMain (`d-isman`) + : Processes pending InstantSend locks. Thread pools ------------