solana-with-rpc-optimizations/ledger-tool
steviez b91da2242d
Change Blockstore max_root from RwLock<Slot> to AtomicU64 (#33998)
The Blockstore currently maintains a RwLock<Slot> of the maximum root
it has seen inserted. The value is initialized during
Blockstore::open() and updated during calls to Blockstore::set_roots().
The max root is queried fairly often for several use cases, and caching
the value is cheaper than constructing an iterator to look it up every
time.

However, the access patterns of these RwLock match that of an atomic.
That is, there is no critical section of code that is run while the
lock is head. Rather, read/write locks are acquired in order to read/
update, respectively. So, change the RwLock<u64> to an AtomicU64.
2023-11-10 17:27:43 -06:00
..
src Change Blockstore max_root from RwLock<Slot> to AtomicU64 (#33998) 2023-11-10 17:27:43 -06:00
tests
.gitignore
Cargo.toml Define tick related helper test methods (#33537) 2023-10-10 09:23:18 +09:00