chain difficulty_iter don't need a WriteTransaction batch#1710
Conversation
|
@antiochp Please take review on this. I'm not sure whether the read is safe for us. In case a Is this OK? since the next call will get the updated one. |
|
OK. Now I feel like I have a better grasp of the "writes on multiple threads" behavior - http://www.lmdb.tech/doc/index.html
Specifically -
So there are two things we need to be aware of -
And those two are different, even though they can temporarily look similar to an outside observer. |
Fully agree! Hope you will give a READ ONLY batch for us to call, then it will be much more clean 😄 |
I want to add the 3rd thing which need to be remembered: |
A little bit optimization for chain store batch usage. the chain::difficulty_iter() is a typical
ReadTransactionand batch forWriteTransactionis not necessary. Andreadis not blocking, so it's much better for performance improvement.This PR can fix long processing on store will cause TUI freeze #1616, to avoid cause TUI freeze.
And it's the base of feature: tui: add downloading progress percent for txhashset download #1702.