D2 weak references

Leandro Lucarella llucax at gmail.com
Mon Apr 20 17:30:47 PDT 2009


Michel Fortin, el 20 de abril a las 18:53 me escribiste:
> On 2009-04-20 18:31:28 -0400, Sean Kelly <sean at invisibleduck.org> said:
> 
> >Yeah.  The unfortunate tradeoff is that finalizers are run while all these
> >app threads are suspended, and if these finalizers enter a synchronized
> >block they're likely to deadlock.  This happened enough with the Phobos
> >GC that I was motivated to make the change in the first place.  It's
> >unfortunate, but at least WeakRef is the only victim of the current
> >approach that I'm aware of.
> 
> Then can't you notify the weak refs, restart the world, and then
> finalize the objects for real?

I've not followed this thread very closely but I think that would imply
that the sweep phase had to run with all threads suspended, which is a bad
idea unless you *really* enjoy pauses =)

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Karma police
arrest this man,
he talks in maths,
he buzzes like a fridge,
he's like a detuned radio.



More information about the Digitalmars-d mailing list