Skip to main content
GameDev.net gamedev.net
🔒 Locked

Algorithm for Cache Coherence

Started by rottyguy Sep 21, 2009 at 10:17 AM 0 replies 600+ views
Original Post
rottyguy
rottyguy
Greetings, We have an app written in C# that handles many incoming requests. We use in-memory data caches as part of our request processing for speed. Periodically (every few minutes), we update some of these caches during runtime (they vary in their frequency of updates based on the cache). There are several caches (20-30) that are used in the system given the nature of the data and request processing requirements. Currently, the way we update them is, basically, making a duplicate of the existing caches, applying the update, and atomically swapping out the caches so that its coherence is preserved. This approach can consume quite a bit of memory (2 versions of the cache in memory) and with all the gen-2 objects, can cause issues (note: we also employ object pooling to keep from polluting the generations too much). I am looking for alternate ideas that doesn't involve duplicating the caches. The requirement is that a request, once it has started to process, must be able to complete with all version of the cache data in tact (e.g. old data in one cache can't be used with new data in another cache). TIA

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.