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