Author: Michael Grønager 2012-02-03 09:52:22
Published on: 2012-02-03T09:52:22+00:00
In a conversation between Michael Gronager and Pieter Wuille, Michael discusses his refactorings and how they could be incorporated into the Satoshi codebase. Pieter expresses concern about thread safety in the blockchain structure, wondering how Michael guarantees no other thread modifies it while he queries it. Michael explains that the BlockChain class only allows access to restricted queries on the chain and encapsulates all access to the blockchain. The database also keeps a mutex to protect reads from writes. Michael acknowledges that constness alone does not guarantee thread safety, but it is one of several measures to ensure it. The list of allowed queries are the const public methods of BlockChain. Michael suggests reviewing all public const methods to ensure nothing was overlooked. Pieter mentions moving to read-write locks that allow multiple threads to read the datastructure simultaneously, but removing the locking altogether sounds wrong to him. Michael Gronager is the Director of Ceptacle, located in Copenhagen, Denmark.
Updated on: 2023-06-05T02:49:21.573423+00:00