Re: Doubling up pointers

Florian Weimer <[email protected]> Tue, 15 Nov 2011 20:49:45 +0100
Newsgroups gmane.comp.programming.garbage-collection.general
Message-ID <[email protected]>
* Jon Harrop:

> In the context of taking a snapshot of the topology of the heap, I'm
> wondering if anyone has considered or tried replacing each pointer with a
> pair of pointers and having the mutators work on the first/second of each
> pair while the GC traverses the second/first of each pair?

Cheng, Blelloch, "A Parallel, Real-Time Garbage Collector" (1999/2000)
uses wide pointers and a global flip switch to get an atomic update of
part of the root set, without special hardware support.

> Perhaps the first phase would write to the left-hand pointer, the
> second phase would have mutators write to both left- and right-hand
> pointers while the GC threads copied every left-hand pointer over
> its right-hand pointer and the third phase would have mutators write
> just to right-hand pointers.

Pizlo et al.'s STOPLESS collector does something like this, but they
keep the additional pointer copy around only during concurrent
compaction.