D future ...

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 21 23:39:47 PST 2016


On 12/21/2016 6:50 AM, thedeemon wrote:
> Have you seen this one?
> http://www.infognition.com/blog/2014/the_real_problem_with_gc_in_d.html

Although I had called them write gates, write barriers are the same thing. Yes, 
that's the problem with implementing a generational collector in D.

I once tried to implement write barriers by using the hardware VM system. I'd 
mark the old generation pages as read-only. When the program would write to 
those pages, a seg fault happened. This would then run a handler in the GC code 
which would mark that page as "dirty", then write-enable the page, and restart 
the program at the point where it seg faulted.

This worked great. The only trouble was that the seg faulting path at runtime 
was so slow it ruined the speed advantage of not have write barriers. So I had 
to abandon it.

But that was long ago. Maybe the tradeoff is better these days with modern 
hardware. But I suspect that if other GC developers are not using this 
technique, it is still too slow.


More information about the Digitalmars-d mailing list