--MimeMultipartBoundary
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 11 May 1998, Andres Kroonmaa wrote:
> Select-based writes have the advantage that when OS buffers are full, select
> would not report ready-for-write FD's, while with threads we have to cope
> with blowing request-queues.
>
> I think that its almost same with read's. If OS reports to select that you
> can read from given FD, then its almost sure that some part of data is already
> inside OS buffers, so using threads for reading that data gives little, IMHO.
Select(2) algorithm probably depends on the OS. If you check FreeBSD code (if
I recall correctly), it returns "ready" for _every_ disk file descriptor that
was set in select call. That is, there is no prefetching on preparation on
the part of the OS as far as disk I/Os are concerned. Also, in 99.99% of
cases the OS will disk-read or disk-write the exact amount you've asked for.
Network FDs are a different story.
I am not sure about commercial systems, but would not be surprised if they
utilize a similar approach.
Alex.
--MimeMultipartBoundary--
Received on Tue Jul 29 2003 - 13:15:49 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:47 MST