guile-devel
[Top][All Lists]
Advanced

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

Re: continuation efficiency


From: Dale P. Smith
Subject: Re: continuation efficiency
Date: Tue, 10 Jul 2001 13:05:16 -0400

Rob Browning wrote:
> 
> address@hidden (Thomas Bushnell, BSG) writes:
> 
> > The danger supposedly avoided by using unwind-protect (in Lisp) or
> > dynamic-wind (in Scheme) around the call to proc is that an error will
> > happen, we'll totally abandon proc, and then the port will be "left
> > open" forever and needlessly.  That's a fake worry.  A correct system
> > will gc the port object as soon as this happens, if indeed, we have
> > totally abandoned proc.
> 
> Unless I'm misunderstanding you.  I disagree.  A "correct" system
> might not GC the port object until much later, if ever.  It might
> defer the GC until later if it has plenty of RAM in order to increase
> performance, and if the app doesn't generate much further garbage, the
> GC might not clean up the port until the whole app quits.  Heck, I'm
> not even sure there's anything that guarantees that if the app quits
> with garbage still available, the GC can't just declare it "collected"
> by exiting the process on systems that automatically reclaim the app's
> heap.

I just ran into this the other day.  The guile-pg package has no
provision for closing connections to the server. It closes the
connection when the gc frees the connection smob.  At one time, I got
errors because the server would not accept any new connections, because
the gc hadn't run yet to close all the unused connections.  Not all
resources are memory!

-Dale
-- 
Dale P. Smith
Treasurer, Cleveland Linux Users Group http://cleveland.lug.net
Senior Systems Consultant, Altus Technologies Corporation
address@hidden
440-746-9000 x309



reply via email to

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