[m-dev.] Minimal streams diff

Michael Day mikeday at yeslogic.com
Thu Oct 3 13:04:48 AEST 2002


> My understanding was that these things were implemented so that the data
> was buffered first in "user space" by the posix library before being
> sent to the OS (which probably copies the data into another buffer...),
> thereby incurring only one syscall per user space buffer flush.  If this
> is so, then buffering yet again in Mercury is a mistake.

That is indeed how the C library fread/fwrite functions operate, as they
use FILE streams which include a buffer. However if you are
reading/writing a socket file descriptor directly using the read/write
syscalls, you need to do the buffering yourself.

But this is really getting into stream implementation issues, which will
not affect the design of the interface.

Michael

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list