2003-08-18T13:52:50 K Stol: > After reading most of the messages on timely destruction, I still > don't quite understand what it is. If someone has a spare minute > free, could you please explain?
The other explanations certainly have formality to commend them, but somehow they didn't make clear to me at least the real pungent motivation. Those of us who like timely destruction are fond of the fact that, e.g.: IO::File->new(">foo")->print("foo\n"); print `cat foo`; will reliably and robustly print foo. The IO::File handle, which was created and used in the first line, ceases to have a reference to it as soon as that line as finished executing, and so is immediately destroyed, which closes (and therefore flushes) the output file. There's about two decades of academic research whose intent was to make garbage collection fast. Proponents of that work believe that it's possible to have enough cleverness in the compiler to (a) preserve timely destruction, while (b) running faster than refcounting in the "interesting" cases (huge number of accesses to data structures), (c) without unreasonable overhead in more typical use, and (d) not requiring non-portable hardware support (e.g. reaching into the hardware MMU, setting pages readonly, and catching and servicing the access exceptions when writes are attempted to the pages). Is there really any such GC in existence anywhere? -Bennett
pgp00000.pgp
Description: PGP signature