[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add a `read' method for ports
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] Add a `read' method for ports |
Date: |
Mon, 09 Jun 2008 22:59:45 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Hi Neil,
"Neil Jerram" <address@hidden> 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.
- [PATCH] Add a `read' method for ports, Ludovic Courtès, 2008/06/01
- Re: [PATCH] Add a `read' method for ports, Ludovic Courtès, 2008/06/08
- Re: [PATCH] Add a `read' method for ports, Neil Jerram, 2008/06/09
- Re: [PATCH] Add a `read' method for ports,
Ludovic Courtès <=
- Re: [PATCH] Add a `read' method for ports, Neil Jerram, 2008/06/11
- Re: [PATCH] Add a `read' method for ports, Neil Jerram, 2008/06/11
- Re: [PATCH] Add a `read' method for ports, Ludovic Courtès, 2008/06/12
- Re: [PATCH] Add a `read' method for ports, Neil Jerram, 2008/06/12
- Re: [PATCH] Add a `read' method for ports, Ludovic Courtès, 2008/06/24