[Proposal] Weak reference implementation for D

Sean Kelly sean at invisibleduck.org
Tue Oct 15 16:20:37 PDT 2013


On Tuesday, 15 October 2013 at 22:09:17 UTC, Robert wrote:
>
> The problem is that destructors and thus the registered hooks 
> for the dispose events are called when threads are already 
> resumed. If this wasn't the case there would actually be no 
> problems.

Gotcha.  Looking at the code... I think you'll get this to work, 
but manipulating such user-mode weak references seems really 
expensive.  Why not work on a DIP to get them built in?  For 
example, one option might be to have the GC perform certain types 
of finalization while the world is stopped.  This would have to 
be limited to very rudimentary stuff, and the easiest way to 
guarantee that would be to have everything live in Druntime.


More information about the Digitalmars-d mailing list