WeakDictionary value 0 for valid key 
Author Message
 WeakDictionary value 0 for valid key


>We've been dealing with a problem with WeakDictionary with VisualWorks
>2.5.1.  We're using the dictionary as a keyed cache for objects
>instantiated from Oracle database data.  Trouble is, every once in a
>while, when we do "at:ifAbsent:", we get the value 0.  We traced this to
>the fact that we caught a value that was being garbage collected
>The comments for WeakDictionary seem to say this kind of thing shouldn't
>happen: "Most accessing methods contain critical regions using the
>accessLock, so that finalization does not occur during an access."  What
>gives?  Does anyone know why we're seeing this kind of behavior?

To my knowledge, the only time this kind of thing can happen is when you
access the dictionary at a priority higher than the finalization process,
which runs at priority 90 (Processor>>lowIOPriority), or the finalization
process was suspended or terminated abnormally for some reason (like
a delay or bug in the executor's code of the WeakDictionary).  Of course,
assumes that the VW finalization mechanism has no holes between when
the object is GC'd by the VM and when the finalization loop is told to run.

Some simple workspace tests of mine (VW 2.5.2) ran with no problems,
until I upped the priority above that of the finalization process.


Arbor Intelligent Systems

Wed, 18 Jun 1902 08:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Is NULL a valid one word key value for Tcl_CreateHashEntry

2. (or (gethash key table) (setf (gethash key table) new-value))

3. valid hash keys

4. Stream_Access value valid across Close/Open?

5. Valid Values

6. valid values for internal file

7. generating primary key value

8. splitting a large file based on the change of values in a key field

9. sorting a list of key value pairs

10. what is a WeakDictionary?

11. [Fwd: Re: VA - WeakDictionary]

12. WeakDictionary and become


Powered by phpBB® Forum Software