Hi Neil,

"Neil Jerram" <[EMAIL PROTECTED]> writes:

> Sorry for not commenting before...  I've reviewed the history, and
> started looking through the patches, and I'm feeling (possibly)
> confused.  Am I correct in thinking that the "problem" here (which you
> are aiming to solve) only affects unbuffered ports?

Yes, such as sockets.

> If that's right, I'm not clear why the solution is involving so much
> restructuring - can't it be done without introducing the new "read"
> field?

I don't think so.  Currently, when asking for N bytes at the application
level, e.g., via `uniform-vector-read!' or `scm_c_read ()', we end up
going through a series of `scm_fill_input ()'.  For unbuffered ports,
this translates into N `scm_fill_input ()', and for unbuffered file
ports, into N one-byte `read(2)' calls.

IOW, the information about how many bytes are requested by the
application isn't currently transferred to port implementations.  This
is what the `read' method aims to solve.

The `read' method also has the advantage that it doesn't need to fiddle
with `port->read_buf', unlike `fill_input' (but one still has to deal
with it when instantiating a port).

Thanks,
Ludovic.



Reply via email to