durusmail: durus-users: Re: Possible bug in cache code: Re: [Durus-users] Doubt about cache and ghost objects
Doubt about cache and ghost objects
2006-05-24
2006-05-25
Possible bug in cache code: Re: [Durus-users] Doubt about cache and ghost objects
2006-05-25
Re: Possible bug in cache code: Re: [Durus-users] Doubt about cache and ghost objects
2006-05-25
2006-05-26
Re: Possible bug in cache code: Re: [Durus-users] Doubt about cache and ghost objects
2006-05-25
Re: Possible bug in cache code: Re: [Durus-users] Doubt about cache and ghost objects
David Binger
2006-05-26
On May 25, 2006, at 3:40 PM, Jesus Cea wrote:

> The issue
> would be invert the sorting and the make_weak steps.

It seems like this would only provide an advantage if
you expect to have cases where an instance is accessed
more recently than any instance that refers to it, and
somehow all referrers have been ghosted or removed
from memory already.

Unless an application is obtaining instances directly from
the cache by oid, a practice that is undesirable anyway
because it causes double-loads, it seems pretty difficult
to produce the situation where the inversion would provide
an advantage.

By testing the references first, we have advantage of
having fewer instances to sort, and in knowing that
the objects being sorted all still have a reference
in memory (which would seem to indicate a higher probability
of being needed in the future).





reply