Subject: AW: [clisp-list] Re: READ-SEQUENCE-ONCE

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Fri Oct 4 01:53:02 2002

Bruno Haible wrote:

>This is not a well-defined description of some semantics, because a
>single read() on a BSD system is not the same thing as a single read()
>on a SysV system.
That's why I talked about the pragmatics of the function, not the semantics :-)

BTW, I still prefer the name read-partial or read-some over read-once, because it describes *what* it does, instead of *how* it does it.

>On SysV, read() can return with a "short read"
>[...]   Whereas on BSD systems,
>your READ-BYTE-SEQUENCE-ONCE function will behave just like
>READ-BYTE-SEQUENCE.

Did I understand you correctly: on BSD (e.g. old SunOS, not Solaris), read() would always fill up the full array and therefore delay (when in blocking mode)?
Then obviously, my suggestion and my scenario for threaded servers in blocking mode wouldn't apply.

Dave Richards wrote:
>The reason it was unsafe to trust this was because there
>were implementation of select() (Linux used to be one of them) that would
>falsely select() true when read() would block.
So that's another (or the same?) source of problems.

Both of you seem to state that without non-blocking sockets, one cannot have, on all systems (where CLISP runs on), a read() (or at least a socket recv()) that's guaranteed not to block, even when preceeded by select().

Don wrote:
> > 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.
THe assumption (of apparently Sam and) I was that, if *prefixed by select(), it would not block.
That would have been very nice to use IMHO, but Dave says there are (or were) systems where this doesn't (or didn't) work.

Don wrote:
>(I don't want to waste all day with select saying ready and read/write
>doing nothing.)
That's why my idea was to use blocking mode, so that at least one call to read/write be executed, resulting in something read/written. I wished for strict monotonic behaviour, instead of possible polling.
Me too, I wanted no polling. I wanted strict monotonic behaviour in mathematic terms. I thought this could be achieved still using a combination of blocking sockets and select(). It seems, through Bruno's and Dave's comments, that this is not achievable on all platforms.

Regards,
	Jorg Hohle.