Comment 0 for bug 143566

Revision history for this message
Dieter Maurer (d.maurer) wrote :

Uploaded: cache_flex_int.pat

Currently, "cPersistance.c" and "cPickleCache.c" are quite tightly bound:
"cPickleCache.c" knows the complete "cPersistentObject" internals
while "cPersistence.c" knows the cache's ring and its number of non ghost
objects. This tight binding makes it difficult to implement other cache
schemes.

Currently, I need to share a common cache among all mounted connections.
Future plans are cache replacement strategies that take approximations
of object size into account.

The attached patch replaces the cache interface for "cPersistence"
by a method based API. Rather than directly using "Cache.ring_home"
and "Cache.non_ghost_objects" directly, some functions are
called: "[un]ghostify", "access", "is_ghost", "unreferenced".
This not only provides more flexibility but is also more readable
and maintainable. On the other hand, it is slightly less efficient.