[squeak-dev] WeakArray and use of weak collections.

Igor Stasenko siguctua at gmail.com
Mon Feb 25 15:33:40 UTC 2008


On 25/02/2008, Gary Chambers <gazzaguru2 at btinternet.com> wrote:
> Today I've had "fun" trying to fix a problem with our software (that uses
>  many processes running at various priorities). Due to the use of a
>  WeakIdentitykeyDictionary I was running into problems witht the dictionary
>  having multiple identical keys... not pleasant, especially when it gets to
>  around 27000 entries (should be 20).
>
>  I have traced the problem to the fact that finalisation is not thread-safe
>  with respect to access of said dictionary. As a fix I have implemented a
>  #critical: method on the WeakArray class that evaluates the given block with
>  a #critical: call on the FinalizationLock of WeakArray.
>
>  Access to the weak dictionary is now wrapped with a WeakArray critical:
>  [...] and the problems have, thankfully, disappeared.

Is this means, that if i'm having multiple instances of WeakArray, i
can access only to one of them at given point of time?
If so, then it's bad :)

>
>  I can post a Mantis entry for this if you all think it is appropriate. Just
>  wondering how many other places in existing Squeak code might trip up on
>  this.
>
>  Regards, Gary.
>
>
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list