[Gc] System V contexts and stack marking

Bruce Hoult bruce at hoult.org
Mon Aug 13 18:09:44 PDT 2007


On 8/14/07, Boehm, Hans <hans.boehm at hp.com> wrote:
> > We use GC in our cooperatively-threaded environment.  We
> > simply use GC_push_other_roots on thread stacks other than
> > the current one, and set GC_stackbottom on each thread switch
> > to keep other things happy.
> > We don't define THREADS.
> >
> That's surprising to me.  You might want to look at the code around
> misc.c:300 in the CVS version.  It tries to clear the stack once a
> collection cycle, up to the hottest SP value it has seen recently.  If
> the collector is invoked from a different stack, it is likely to try to
> clear the area between stacks, with bad results.  I remember seeing
> failures along those lines.
>
> Perhaps you are always triggering the GC from the main thread?  If not,
> it would be usefull to know what that code is actually doing in your
> environment.

Ah, you're correct.  I see I've added a #define DONT_CLEAR_STACK into
our part of gcconfig.h and test it in half a dozen places in
gc_priv.h, malloc.c, mallocx.c, misc.c and typed_mlc.c.


More information about the Gc mailing list