[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: more on finalization issue, and reference implementation
From: Michael Sperber <sperber@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: more on finalization issue, and reference implementation
Date: Sun, 28 Aug 2005 17:44:00 +0200
> Shiro Kawai <shiro@xxxxxxxx> writes:
> > Does the runtime system do it automatically upon program
> > termination?
> Depends on what you mean by automatic. It needs to be triggered
> explicitly, but it happens, for example, when you type ,exit in the
> REPL or a SRFI-22-style script finishes running.
That's what I had in my mind.
> > In such a case, I guess you should have a weak table to keep a set
> > of opened ports, right?
> No, it remembers which ports still have buffers that need flushing.
Ah, I see. You keep a pool of ports with pending output, and
if its buffer is flushed the port is taken out from the pool,
and if it gets the buffered data again the port is added to the
pool. Then you surely don't need weak pointers, hmmm.