thread-safe-lru
thread-safe-lru copied to clipboard
Why not block in `find` at lock acquiring?
In find method, the code doesn't block when the ListMutex lock is already held by another thread. But this may cause the eviction violate LRU policy.
If a pair is frequently visited. But unfortunatly, each time the visiting thread could not acquire ListMutex, the pair will always stay near the tail of the LRU list and is vulnerable to be evicted - which is not expected under LRU policy.