Re: O_NONBLOCK on files

Matti Aarnio (matti.aarnio@zmailer.org)
Mon, 24 Sep 2001 23:47:17 +0300


On Wed, Sep 19, 2001 at 12:24:39AM -0700, Simon Kirby wrote:
> On Wed, Sep 19, 2001 at 01:05:06AM -0600, Eric W. Biederman wrote:
> > What would cause the data to be read in if read just checks the caches?
> > With sockets the other side is clearing pushing or pulling the data. With
> > files there is no other side...
>
> Hmm...Without even thinking about it, I assumed it would start a read and
> select() or poll() or some later call would return readable when my
> outstanding request was fulfilled. But yes, I guess you're right, this is
> different behavior because there is no other side.

To push the idea into ultimate: AIO

You open file, start IO, and do other things while the machine
is doing IO. Doing open() asynchronously would be ultimate,
but alas, not particularly trivial.

There are problems also in the AIO status rendezvous mechanisms.

Your best choice could be (with moderation) to do synchronous
operations at separate threads.

> Reading a file would need a receive queue to make this work, I guess. :)
> Simon-
> [ sim@stormix.com ][ sim@netnation.com ]

/Matti Aarnio
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/