DIP60: @nogc attribute
Manu via Digitalmars-d
digitalmars-d at puremagic.com
Sat Apr 19 22:21:32 PDT 2014
On 20 April 2014 14:33, via Digitalmars-d <digitalmars-d at puremagic.com>wrote:
> On Sunday, 20 April 2014 at 00:59:26 UTC, Manu via Digitalmars-d wrote:
>
>> Interpretation: this struct and any data directly reachable from it is
>>> guaranteed to not be GC allocated. Then a precise collector could avoid
>>> scanning those and pointers to them.
>>>
>>
>> Why wouldn't precise GC be able to do this anyway? It already has data
>> about everything it scans. It can easily produce a 'don't bother scanning
>> this' bit at the start of that data without programmer assistance?
>>
>
> It doesn't know what can be reached through a node in a graph. It doesn't
> know what is on the GC heap.
>
>
> In a visual realtime app, the GC will only be acceptable when it will not
>> interrupt for more than 1ms or so (and I consider that quite generous, I'd
>> be more comfortable with < 500µs). Otherwise you'll lose frames anyway; if
>>
>
> No, because the @nogc thread will not be interrupted.
>
> Think MVC: the model is under GC, the view/controller is under @nogc.
>
I don't really see why a proposed @nogc thread wouldn't hold references to
GC allocated objects... what would such a thread do if it didn't have any
data to work with?
@nogc just says the thread won't allocate, it can still be holding all the
references it likes, and still needs to be scanned.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140420/73dcb54d/attachment-0001.html>
More information about the Digitalmars-d
mailing list