From c8c13517e059fe37db56c517ffc412d18c53a0ab Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Thu, 1 Oct 2015 02:00:34 +0200 Subject: [PATCH] TODOs --- implementations/caching/cache/Cache.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/implementations/caching/cache/Cache.h b/implementations/caching/cache/Cache.h index 63ca8d25..8660b663 100644 --- a/implementations/caching/cache/Cache.h +++ b/implementations/caching/cache/Cache.h @@ -107,6 +107,10 @@ void Cache::_popOldEntries() { // _cachedBlocks vector at the same time. // There is a regression test case for this: CacheTest_RaceCondition:PopBlocksWhileRequestedElementIsThrownOut. while (true) { + //TODO Since there are 4 threads running this, there will always be one having one of the shared locks. + // That is, while purging is running, no thread has a chance of calling pop() or push() and purging has priority. + // Fix this, use something like priority locks for pop() and push()? + // http://stackoverflow.com/questions/11666610/how-to-give-priority-to-privileged-thread-in-mutex-locking boost::upgrade_lock lock(_mutex); boost::optional oldEntry = _popOldEntry(&lock); if (oldEntry == boost::none) {