D2 weak references

Jarrett Billingsley jarrett.billingsley at gmail.com
Mon Apr 20 14:32:30 PDT 2009


On Mon, Apr 20, 2009 at 5:03 PM, Sean Kelly <sean at invisibleduck.org> wrote:

> The horrible thing about all this is it makes using a multithreaded
> WeakRef horribly slow.  Even if the GC facility were provided for
> what you want to do you're talking about acquiring a mutex in
> the GC for every deref operation.  What a mess.

Then take a hint from D2 and make them thread-local by default ;)  But
provide a SharedWeakRef for the cases where you need it.



More information about the Digitalmars-d mailing list