bitfaster / BitFaster.Caching

High performance, thread-safe in-memory caching primitives for .NET
MIT License
466 stars 28 forks source link

Mitigate LFU struct tearing (new node) #596

Closed bitfaster closed 3 weeks ago

bitfaster commented 4 months ago

When updating a large struct, instead of updating in place, we can instead create a new node. Since nodes are not updated, no tearing can occur.

Time based expiry is a special case that is handled as follows:

TODO:

coveralls commented 4 months ago

Coverage Status

coverage: 98.702% (-0.4%) from 99.141% when pulling 15edc9f55e4783c5c1617cebb4ef378bf4e319e3 on users/alexpeck/tornwrite3 into 07f8a1cc68229a29472077b2891690e0bfd46951 on main.

bitfaster commented 3 weeks ago

Superseded by #621