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

Re: closing reader / writer

This page is part of the web mail archives of SRFI 68 from before July 7th, 2015. The new archives for SRFI 68 contain all messages, not just those from before July 7th, 2015.

Shiro Kawai <shiro@xxxxxxxx> writes:

> reader-close and writer-close seem missing from the current draft.

Good catch---will be fixed!

> It may also be good to note that the 'close' procedure passed to
> make-simple-reader/make-simple-writer is called only synchronously,
> when reader-close/write-close procedure is called.

I'm not sure what this would mean.  With "synchronously," do you mean
to prevent other processes in the system, such as GC or finalization?
You seem to be saying that below ...

> (Another option is to allow an implementation to call 'close' when
> the reader/writer is about to be GC-ed, but that'd make it difficult
> to write portable code using srfi-68).

I'm not sure that's the case.  There are good reasons for allowing a
GC finalizer to close a reader or writer (and I suspect most Scheme
systems close a port that's no longer reachable).  Of course, relying
on this property in a program is bad---but it's hard to say how a
program could, given the inherent unreliability of if and when a
finalizer is called.

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla