Re: async-io for reads & writes

From: Michael O'Reilly <michael@dont-contact.us>
Date: 12 May 1998 09:21:38 +0800

"Andres Kroonmaa" <andre@ml.ee> writes:

> 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.
 
> am i missing something?

As has already been pointed out, select() always returns true for
reading/writig on disk file descriptors.

Problem is that it's next to impossible to work out of a write() or a
read() is going to block. A write will only be non-blocking if there
are clean buffers available to write into, but there are other
processes using the buffer pool.... etc etc. So the safest thing is to
always do it in a seperate thread.

Michael.
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