On Wed, 2011-02-02 at 14:31 -0500, erik quanstrom wrote:
> > I don't follow.  Garbage collection certainly can be done in a library
> > (e.g., Boehm).  GC is in my experience normally triggered by
> > 
> >       * Allocation --- which is a function call in C
> >       * Explicit call to the `garbage collect now' entry point in the
> >         standard library.  A function call in every language.
> > 
> > What other events canonically would trigger garbage collection, but not
> > be invoked by function calls?
> 
> i should have said automatic garbage collection.

> i think of it this way, the janitor doesn't insist that the factory shut
> down so he can sweep.  he waits for the factory to be idle, and then
> sweeps.

I think factory owners get pretty upset when their factories idle.

I still think the program needs to call into the threading library
(whether you call it part of the RTS or not) to idle.  So the only
benefit you have is that putting threading and the garbage collector
into the RTS allows you to ignore the abstraction barriers between the
two systems, which makes it easier for the thread system to signal the
garbage collector.  I mean, if the thread does this (making up syntax on
the spot):

        start := now();
        while (now() < start + 2hours);

You don't expect GC to be able to trigger, right?

jcc



Reply via email to