Subject: [clisp-list] READ-CHAR/BYTE-SEQUENCE-NONBLOCKING

From: [email-masked] (Don Cohen)
Date: Thu Oct 3 13:37:02 2002

> > If you rename them to READ-CHAR-SEQUENCE-NONBLOCKING and
 > > READ-BYTE-SEQUENCE-NONBLOCKING it's easier to understand what they do.
 > 
 > But they are _not_ non-blocking!
 > they call read/write just once, and if that blocks, they do too.

This is exactly what I DON'T want!
For what I DO want the name NONBLOCKING seems very appropriate.

I want a function that will never block, and will read/write as many 
chars/bytes as it can immediately, up to a specified limit.
For best performance I suggest that we pass it an array, 
a start index and an end index (or maximum number of chars/bytes 
to read/write), and that it put/get the chars/bytes to/from that
array, returning the number that were actually read/written.
That number could even be zero.
I would hope, however, that there would be a small limit on the number
of times that select can tell you that a stream is ready to read/write
after which the corresponding nonblocking operation returns zero.
(I don't want to waste all day with select saying ready and read/write
doing nothing.)
The one case where I do want select to say ready and the operation to
return zero is when eof arrives (and I've already read everything up
to the eof), but in that case the operation should "read" the eof, so
select no longer reports that there's something waiting to be read.