Concurrent LRU
An implementation of a concurrent LRU cache. It is designed to hold heavyweight resources, e.g. file descriptors, disk pages. The implementation is heavily influenced by the LRU cache in LevelDB.
Currently there are two implementations, unsharded
and sharded
.
unsharded
is a linked hashmap protected by a big lock.sharded
shardsunsharded
by key, providing better performance under contention.
Example
use LruCache;
use ;
Contribution
Contributions are welcome! Please fork the library, push changes to your fork, and send a pull request. All contributions are shared under an MIT license unless explicitly stated otherwise in the pull request.
Performance
TODO