Increase parallelity level for cache flushing
This commit is contained in:
parent
92d0d073a5
commit
9a27cea138
3
implementations/caching/cache/Cache.h
vendored
3
implementations/caching/cache/Cache.h
vendored
@ -126,7 +126,8 @@ void Cache<Key, Value, MAX_ENTRIES>::_deleteOldEntriesParallel() {
|
||||
|
||||
template<class Key, class Value, uint32_t MAX_ENTRIES>
|
||||
void Cache<Key, Value, MAX_ENTRIES>::_deleteMatchingEntriesAtBeginningParallel(std::function<bool (const CacheEntry<Key, Value> &)> matches) {
|
||||
unsigned int numThreads = std::max(1u, std::thread::hardware_concurrency());
|
||||
// Twice the number of cores, so we use full CPU even if half the threads are doing I/O
|
||||
unsigned int numThreads = 2 * std::max(1u, std::thread::hardware_concurrency());
|
||||
std::vector<std::future<void>> waitHandles;
|
||||
for (unsigned int i = 0; i < numThreads; ++i) {
|
||||
waitHandles.push_back(std::async(std::launch::async, [this, matches] {
|
||||
|
Loading…
Reference in New Issue
Block a user