From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Cast To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: <1b02265d72d36587244181d64c04e8e0@brasstown.quanstro.net> References: <86ipx4s36p.fsf@cmarib.ramside> <86ei7ry76s.fsf@cmarib.ramside> <86zkqf46vz.fsf@cmarib.ramside> <86mxmfuiep.fsf_-_@cmarib.ramside> <1296674131.17627.59.camel@jcast-desktop> <1b02265d72d36587244181d64c04e8e0@brasstown.quanstro.net> Content-Type: text/plain; charset="UTF-8" Date: Wed, 2 Feb 2011 12:07:34 -0800 Message-ID: <1296677254.17627.78.camel@jcast-desktop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Modern development language for Plan 9, WAS: Re: RESOLVED: recoving important header file rudely Topicbox-Message-UUID: a8d70816-ead6-11e9-9d60-3106f5b1d025 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