On 18/01/2007, at 5:36 PM, Tom Benson wrote:


On 18/01/2007, at 8:33 PM, Andy Dent wrote:

off the top of my head:
dim v as variant = myObject
dim id as integer = v.integerValue  ' we now have the unique ID
dim theKey as string = Hex(id) ' string representation has no link to the object, so no effect on reference count


I was under the impression that there was no guarantee that variant.integerValue would return a unique value for an object, only for integer's and colours... or am I thinking of variant.hash???

you are and I'm tired and that should have been variant.hash :-/


Either way, my database automatically supplies a unique id with each data block, so that is not really the issue. The issue is removing that object from my lookup dictionary once the rest of the program drops all references to that object.
sorry, I misunderstood your problem.

I thought you were suggesting the object was stuck in the dictionary because it had been used as a key.

can you explain the workflow a bit more please.

It seems something like:
1) data block created
2) time passes
3) something uses data block, finding it by ID
4) something else uses data block, overlapping with earlier user (otherwise refs would fall to 1)
5) all things that could use that data block are stopped
6) data block is redundant and could be purged - why not just remove it?

I'm not sure I understand the transitions between block being created and available, block used and then block being redundant.

If this is a cache cleanup thing, why not have a LastUsed value on blocks and flush them once they are stale beyond a certain point, driven by a thread woken up every so often and only being active based on memory reaching a threshold?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to