[squeak-dev] Re: Odd performance characteristics of symbol creation

Andreas Raab andreas.raab at gmx.de
Thu May 7 00:42:36 UTC 2009

Nicolas Cellier wrote:
> Maybe #finalize could be sent directly by WeakKeyDictionary ?
> WeakRegistry are protected forMutualExclusion, WeakKeyDictionary is not.
> So WeakRegistry must stay.
> There might be more subtle things you know better than me...
> ... like finalizeValues is two folds:
> 1) clean-up valueDictionary in a protected block
> 2) finalize outside this block
> Didn't get why... could #finalize have a chance to modify valueDictionary?

No, but it could potentially take a long time and the idea was to not 
lock the entire registry while it's doing the finalization. The 
background is that you might be doing something like saying "socket 
close" where the close could take 20 secs. However, knowing what I know 
today I would argue that doing something like that isn't a valid 
approach to finalization anyway because it happens at high priority (if 
it takes twenty seconds then fork the damn finalizer!). So moving 
finalize into the critical secion (and into WeakKeyDictionary) is fine 
from my perspective.

   - Andreas

More information about the Squeak-dev mailing list