[R6RS] I/O <-> GC question

Michael Sperber sperber
Tue Nov 23 05:58:23 EST 2004


I have a technical question for the implementors that arises with the
design of the I/O system:

I/O buffers are ultimately vectors of bytes.  Let's hypothetically
presume for a moment that byte vectors are available in R6RS.

Now, for an I/O buffer it may be desirable that it remains stationary
in memory so that an asynchronous OS I/O API (such as that of Windows)
can read or write data from it behind the scenes.  So it seems it
would be nice if I/O buffers are special in the sense that they don't
get moved by the GC.

I'm wondering what impact this has on the API---is it sufficient to
offer something like MAKE-I/O-BUFFER-BYTE-VECTOR, where the objects it
creates are still regular byte vectors from the program perspective
(i.e. they answer true to the same predicate, and the same procedures
work on them as for regular byte vectors), or is a completely disjoint
type necessary?

For obvious reasons, it would be nice if the same type could be used,
but I'm not sure if any GC implementation strategy out there would
have trouble with that.  I would appreciate some insight from the more
experienced GC hackers on the list.

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla


More information about the R6RS mailing list