Bitcoin Core 28.99.0
P2P Digital Currency
|
Public Member Functions | |
template<typename Cache > | |
void | test_cache_erase_parallel (size_t megabytes) |
Public Member Functions inherited from BasicTestingSetup | |
void | SeedRandomForTest (SeedRand seed) |
Seed the global RNG state and m_rng for testing and log the seed value. More... | |
BasicTestingSetup (const ChainType chainType=ChainType::MAIN, TestOpts={}) | |
~BasicTestingSetup () | |
Additional Inherited Members | |
Public Attributes inherited from BasicTestingSetup | |
util::SignalInterrupt | m_interrupt |
node::NodeContext | m_node |
FastRandomContext | m_rng |
fs::path | m_path_root |
fs::path | m_path_lock |
bool | m_has_custom_datadir {false} |
ArgsManager | m_args |
Test-specific arguments and settings. More... | |
Definition at line 192 of file cuckoocache_tests.cpp.
|
inline |
We make a copy of the hashes because future optimizations of the cuckoocache may overwrite the inserted element, so the test is "future proofed".
Grab lock to make sure we release inserts
Insert the first half
Spin up 3 threads to run contains with erase.
Erase the first quarter
Each thread is emplaced with x copy-by-value
Wait for all threads to finish
Grab lock to make sure we observe erases
Insert the second half
elements that we marked erased but that are still there
elements that we did not erase but are older
elements that were most recently inserted
Definition at line 194 of file cuckoocache_tests.cpp.