
Cache Implementations in C# .Net - pplonski86
https://michaelscodingspot.com/cache-implementations-in-csharp-net/
======
itcheeze
I think that this is great for the most part. I think that in process caching
in C# can be tricky, especially dealing with concurrency because even through
the access to the backing dictionary for creating and retrieving is safe
(assuming the function delegate for creating the object doesn't do something
interesting), you are returned a reference to an object in memory.

At this point if you have multiple threads doing stuff with that object you
can obviously run into issues.

Anyway concurrency is hard. I keep thinking of writing a cache that uses
something like
[https://github.com/ReubenBond/DeepCopy](https://github.com/ReubenBond/DeepCopy)
to return a copy of the object.

