Re: [Gc] Callbacks for GC events.

Ivan Maidanski ivmai at
Mon Nov 8 12:00:57 PST 2010

Hi, Paul!

1. Of course, we could commit the patch (if no objections for the community) but we need time for the review.
2. For collection begin, there is already GC_set_start_callback. Is this the same as your or not? (I haven't looked into code yet.)
3. As I recall, mono's port of GC has similar functionality. Could you investigate this and produce the patch adding the functionality you need but having the same API for it as in mono?


Mon, 8 Nov 2010 14:47:07 +1100 Paul Bonet <pbone at>:

> Hi,
> I've written a patch against BoehmGC (attached) that introduces callbacks
> that
> the GC calls for certain events.  I'm interested in the following events:
>     + Collection begins
>     + Collection ends
>     + This thread is stopping (because the world is stopping).
>     + This thread is resuming (because the world is resuming).
> I use this for profiling the execution of multicore programs, these events
> along with events from Mercury's[1] runtime can be used to generate a
> visualisation of a program's execution.  The visualisation is rendered can
> be
> be explored with the ThreadScope[2] tool.
> I have two questions:
>     1. Can somebody please commit this into BoehmGC's CVS repository so
> that it
>        can be maintained by people who know the garbage collector better than
> I
>        do?
>     2. Have I correctly instrumented the collector?  I understand that my
> patch
>        only supports the pthread method of stopping the world, I'm okay
> with
>        that.  However, I'm not confident that I've instrumented all
> the places
>        where the collector switches from allocation to collection mode and
> back
>        again.  I've had to be careful not to make the collector send two
> 'start
>        collection' events in a row for example.
> 1. Mercury:
> 2. Threadscope:
> ATTACHMENT: application/pgp-signature
> signature.asc_______________________________________________
> Gc mailing list
> Gc at

More information about the Gc mailing list