[Gc] Re: Understanding the performance of a `libgc'-basedapplication

Boehm, Hans hans.boehm at hp.com
Tue Nov 28 16:22:47 PST 2006

> From: gc-bounces at napali.hpl.hp.com 
> FWIW, the profile I sent was obtained on GNU/Linux on PowerPC.
The numbers will vary, but the issue may well be the same.

> > A partial solution is probably to use the thread-local allocation 
> > facility.  For 6.8:
> >
> > 1. Make sure the collector is built with THREAD_LOCAL_ALLOC 
> defined, 
> > and make sure that GC_MALLOC and GC_MALLOC_ATOMIC (all 
> caps) are used 
> > to allocate.  (I'm afraid the collector you used for the profile is 
> > not built with THREAD_LOCAL_ALLOC.  IIRC, that would cause the 
> > collector to switch to pthread locks, and would probably cause your 
> > test to run even slower.)
> >
> > 2. Define GC_REDIRECT_TO_LOCAL and then include gc_local_alloc.h 
> > before making any of the above calls.
> I did so, but the resulting code always segfaults when trying 
> to access thread-specific storage (see below).
I neglected to mention that you probably need to explicitly call GC_init() (in GC7, it should be GC_INIT()).

It sounds like that may be the problem here.


More information about the Gc mailing list