Hello All, Has anyone thought of using copy on write in the ReadWrite cache strategy, instead of locking?
Here is my idea: 1) have a shared session counter: each session can query the counter, which then increments, so each session gets a unique id, unique across threads and machines 2) lock, releaseLock, put and get are passed the session id 3) lock makes a copy of the current cache value, if it exists 4) subsequent reads, writes are applied to the copy 5) releaseLock copies it back to the original cache 6) if the lock has been acquired by multiple sessions, then force read from the database to decide which transaction won (i.e. remove key from cache) With this approach, it would be possible to use memcached as a distributed cache, because we don't need a distributed hard lock anymore. Cheers, Jorge -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
