Subject: Re: bug#30066: 'get-bytevector-some' returns only 1 byte from unbuffered ports

From: Andy Wingo <[email-masked]>
Date: Wed, 10 Jan 2018 18:26:06 +0100

On Wed 10 Jan 2018 17:58, Nala Ginrut <[email-masked]> writes:

> hi Andy and Ludo!
>
> What if developers enabled suspendable-ports and set the port to non-blocking?
> For example, in the non-blocking asynchronous server, I registered
> read/write waiter for suspendable-ports. And save
> delimited-continuations then yield the current task.
> In this situation, get-bytevector-n! will read n bytes with several
> times yielding by the registered read-writer, from the caller's
> perspective, get-bytevector-n! will return n bytes finally no matter
> how many times it's yielded.
> But how about the get-bytevector-some? Should it block just once and
> return the first time read m bytes then return?

I think this is right.  At most one block.  FWIW we'd need to add
support for get-bytevector-some to (ice-9 suspendable-ports) to get this
to work.

Andy