Search code examples
c#dictionarycachinglru

Is it there any LRU implementation of IDictionary?


I would like to implement a simple in-memory LRU cache system and I was thinking about a solution based on an IDictionary implementation which could handle an hashed LRU mechanism. Coming from java, I have experiences with LinkedHashMap, which works fine for what I need: I can't find anywhere a similar solution for .NET.

Has anyone developed it or has anyone had experiences like this?


Solution

  • There is nothing in the base class libraries that does this.

    On the free side, maybe something like C5's HashedLinkedList would work.

    If you're willing to pay, maybe check out this C# toolkit. It contains an implementation.