Hi! On Fri 23 Jun 2017 11:24, ludovic.cour...@inria.fr (Ludovic Courtès) writes:
> With the current protocol, often we’re just reading a handful of bytes. > Full buffering would mean that Guile would block on an 8K read or so > that will never be fulfilled. That's not how it works :) The "read" function of a port should only block if no byte can be read. If 1K bytes are available for an 8K buffer, then the read function should return after filling only 1K bytes; looping to fill at least 8K is some other code's responsibility. In particular, "read" functions should not use get-bytevector-n, as get-bytevector-n is defined to block until N bytes are available. Instead they should use get-bytevector-some. See: https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=0c102b56e98da39b5a3213bdc567a31ad8ef3e73 Andy