Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!ucsd!pacbell.com!att!cbnewsu!cbnewsl!cbnewse!cbnewsi!cbnewsk!cbnewsm!cbnewsd!cbnewsj!cbnewsh!cbnewsc!lgm From: lgm@cbnewsc.att.com (lawrence.g.mayka) Newsgroups: comp.object Subject: Re: What is Objective C? Summary: Garbage collection in real-time systems, et al. Message-ID: <1990Sep12.000528.4726@cbnewsc.att.com> Date: 12 Sep 90 00:05:28 GMT References: <3864@bingvaxu.cc.binghamton.edu> <77500056@m.cs.uiuc.edu> <1990Sep11.030523.19830@cbnewsl.att.com> Organization: AT&T Bell Laboratories Lines: 40 In article <1990Sep11.030523.19830@cbnewsl.att.com>, psrc@cbnewsl.att.com (Paul S. R. Chisholm) writes: > But if I was writing an operating system, or a real time application, > the (unpredictable) overhead of garbage collection might not be > acceptable. Then, I'd be willing to pay the (programmer) effort, and > manage memory better than a garbage collector could. Garbage collection need not be unpredictable, with some degree of hardware support. Lisp machines are certainly able to manage their garbage collection quite precisely, and some research indicates that simple per-page read/write protection constitutes sufficient hardware support on which to build a predictable garbage collector (See the algorithm of Appel, Ellis, and Li.) > Somebody (Lawrence K-something, I think) said that good garbage > collectors are hard to beat, unless you use a fixed-size memory pool or > some such trick. Funny, it sounded as if he was disagreeing with me. > That's *exactly* the kind of technique needed. The difficulty comes in passing around references to an element of such a pool. Do you (a) Deallocate the element "out from under" its references, essentially requiring a validity check before each use of such a reference. (And if processes are preemptible, the validity check must be atomic with the access.) (b) Attempt to keep track of such references, through some inefficient or error-prone scheme. (c) Forbid such multiple references entirely. Advocates of garbage collection consider all these alternatives decidedly unattractive, to say the least. Lawrence G. Mayka AT&T Bell Laboratories lgm@iexist.att.com Standard disclaimer.