Files
UnrealEngineUWP/Engine/Source/Programs/Horde/HordeCommon
Ben Marsh 16ea9a894c Horde: Add an LRU cache for CAS objects, backed by a memory-mapped file on disk. Cache reads are lock free. Writes require a lock but complete in constant time (and do not prohibit reads).
The cache is transactional, and is designed not to lose data if the process is terminated. The cache index and bulk store are kept separate, and blocks in the bulk store are not overwritten until the index has been flushed.

The age of items is tracked via "generations". An 8-bit generation counter is incremented once a certain size of items has been added to the cache, and older entries in the cache can be trimmed periodically by calling TrimAsync().

Since blocks of memory are allocated via memory mapped files and references are not visible to the garbage collector, clients can create locks over the cache which prevents trim operations from running.

[CL 17515095 by Ben Marsh in ue5-main branch]
2021-09-14 22:32:38 -04:00
..