Shared and GC

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 15 09:05:28 PST 2015


On Thursday, 15 January 2015 at 15:31:17 UTC, Peter Alexander 
wrote:
> On Thursday, 15 January 2015 at 15:24:55 UTC, Ola Fosheim 
> Grøstad wrote:
>> That would be nice, because then a precise garbage collector 
>> could choose between local collection scans and global 
>> collection scans.
>
> I think something like this is part of the plan, but shared 
> semantics are still up in the air.

That sounds like a very important aspect of a plan to get fast GC 
without completely changing the language and non-gc performance.

I've looked at bit at how to do a fast stop-the-thread GC. 
Estimates on what the hardware supports (bandwidth and cache 
performance) suggests that it is possible to get acceptable rates 
for not-densely-linked heaps with some tweaks to semantics:

- shared-awareness in new-expressions to support local collection

- removing class-destructors

- locating traceable pointers to the same cachelines in class 
instances (negative offsets is the easy solution)


Then you cn use a ache-optimized collector using batched 
non-caching queues with prefetching to get bitmaps that fits in 
1st level cache without wrecking the cache for other threads and 
having collection dominated by cache misses.


More information about the Digitalmars-d-learn mailing list