[Proposal] Weak reference implementation for D

inout inout at gmail.com
Tue Oct 15 16:26:48 PDT 2013


On Tuesday, 15 October 2013 at 23:20:39 UTC, Sean Kelly wrote:
> 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.

That makes a lot of sense, +1!


More information about the Digitalmars-d mailing list