<oembed><type>rich</type><version>1.0</version><author_name>npub1tjephawh7fdf6358jufuh5eyxwauzrjqa7qn50pglee4tayc2ntqcjtl6r</author_name><author_url>https://nostr.ae/npub1tjephawh7fdf6358jufuh5eyxwauzrjqa7qn50pglee4tayc2ntqcjtl6r</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2012-02-02&#xA;📝 Original message:&gt; You will also find the RPC server in libcoin blistering fast compared to&#xA;the Satoshi client. (It was actually what got me to write libcoin in the&#xA;first place...). The Satoshi client HTTP server executes all rpc commands&#xA;in its own thread, but to do so, it needs to stop the thread of the Node,&#xA;even though the command executed is just a query (i.e. not a SendTo), you&#xA;hence have two threads blocking each other and when they wait, you wait...&#xA;In libcoin all the query methods access the blockChain as a const object&#xA;and they can hence safely query it without intervening the work of the Node&#xA;thread. The exception are the SendTo methods that first query if a&#xA;transaction can take place, then pushes it to the work-queue of the Node&#xA;thread and again exits immediately. The actual execution then follows once&#xA;the Node has finished its current tasks (e.g. validating a block).&#xA;&#xA;Hello Michael,&#xA;&#xA;I&#39;m impressed by your refactorings, and hope some of them can make it into&#xA;the Satoshi codebase. I am however not sure what you&#39;ve said above is safe.&#xA;In particular, how do you guarantee that no other thread modifies the&#xA;blockchain structure while you are performing your query on it? Does the&#xA;query code operate on a const copy of the structure, or is there guaranteed&#xA;only one thread accessing it?&#xA;&#xA;I&#39;ve been thinking about moving to read-write locks that allow multiple&#xA;threads reading the datastructure simultaneously, but removing the locking&#xA;all together sounds wrong to me.&#xA;&#xA;-- &#xA;Pieter&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20120203/270a6572/attachment.html&gt;</html></oembed>