[squeak-dev] Finalization tests failing

Levente Uzonyi leves at elte.hu
Sun Oct 31 20:57:23 UTC 2010


On Sun, 31 Oct 2010, Igor Stasenko wrote:

> On 31 October 2010 18:34, Levente Uzonyi <leves at elte.hu> wrote:

snip

>>
>> There will be another problem with the current implementation of the new
>> finalization scheme. Since the new WeakRegistry doesn't remove the
>> associations from the dictionary, the installed finalizer (#finalizeValues)
>> will be evaluated with the already finalized WeakFinalizerItems. This may
>> cause early finalization or raise an error. The easiest way to avoid this is
>> to use a better finalizer which does nothing if the VM supports the new
>> finalization scheme.
>>
> No, that's actually not a problem. A finalizer item wipes an executor
> object , by setting it to be nil.
> So, next time you may send #finalizeValues to finalizer item, it will
> send #finalize to nil,
> which is no-op.
> Thus there is no chance that same object will be finalized twice.
> See WeakFinalizerItem>>finalizeValues

Sorry, I forgot that Object implements #finalize, so it's fine. There's a 
possible concurrency issue though, but it won't cause any problem, because 
two consecutive assignments are atomic.

There's still an issue with the old finalization scheme, the original 
version has to be restored.


Levente

>
>>
>> Levente
>>
>>>
>
>
>
> -- 
> Best regards,
> Igor Stasenko AKA sig.
>
>



More information about the Squeak-dev mailing list