mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MIT-Scheme-devel] Cleaning weak hash tables in secondary GC daemon?


From: Taylor R Campbell
Subject: Re: [MIT-Scheme-devel] Cleaning weak hash tables in secondary GC daemon?
Date: Tue, 20 Sep 2011 18:33:20 +0000
User-agent: IMAIL/1.21; Edwin/3.116; MIT-Scheme/9.1

   Date: Wed, 14 Sep 2011 20:21:48 +0100
   From: Alexey Radul <address@hidden>

   On Wed, Sep 14, 2011 at 7:42 PM, Taylor R Campbell <address@hidden> wrote:
   > It's not a good idea to call HASH-TABLE/CLEAN! in a GC daemon because
   > it may rehash the table in case it has shrunk.

   Stupid question: why would rehashing the table be bad?

GC daemons should generally be written very carefully, and in
particular should avoid allocation in order to avoid GC loops.

Calling a general hash procedure in a GC daemon is not a good idea:
whoever wrote the hash procedure won't expect it to be called any time
except during an explicit call to a hash table operation on a hash
table with that hash procedure.

   Speaking of which, when are secondary GC daemons run?

When space is short.  The criteria MIT Scheme currently uses are
pretty silly, because the heap size is fixed at boot.  Unfortunately,
no modern general-purpose operating system that anyone cares about
tells you usefully when physical memory is scarce, and virtual address
space is never scarce these days.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]