[Proposal] Weak reference implementation for D

Denis Shelomovskij verylonglogin.reg at gmail.com
Wed Oct 16 03:02:26 PDT 2013


16.10.2013 3:20, Sean Kelly пишет:
> 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.

But someone have to do it. And I can only see it will save one of two GC 
lock/unlock pairs.

-- 
Денис В. Шеломовский
Denis V. Shelomovskij


More information about the Digitalmars-d mailing list