Re: aio_read/write versus O_NONBLOCK
- From: phil-news-nospam@xxxxxxxx
- Date: 28 May 2008 00:36:35 GMT
On Tue, 27 May 2008 15:55:07 -0700 (PDT) David Schwartz <davids@xxxxxxxxxxxxx> wrote:
| On May 27, 11:49?am, William Ahern <will...@xxxxxxxxxxxxxxxxxxxxxxxxx>
| wrote:
|
|> > So what should waiting do in this case? Should it be required to start
|> > a read ahead, changing the state of the socket so that there is an
|> > asynchronous operation?
|
|> The same thing it has always done, return readiness.
|
| Which is what? Are you suggesting it should say that the file is not
| ready for reading (since the data is not available) and that it never
| should return ready no matter how long you wait, perhaps unless some
| other process coincidentally happens to cause the first few bytes of
| data to be resident in memory?
Being "ready to read" does not mean the actual data is in RAM. It just means
you can proceed to do the read call if your program has an interest in
reading something (which presumably it does if you included that descriptor
for reading in poll or select).
|> When an actual I/O
|> request blocks, the kernel then has a sufficient hint to queue a request;
|> it's the prior request that then gets polled on.
|
| Exactly. You want AIO, not non-blocking semantics. You want to issue a
| request and then know what happens to it, not wait for something
| external to happen.
AIO is not necessary outside of the small thinking box you use.
|> From then on, the kernel
|> follows in lock-step; we've swapped the producer-consumer ordering--so that
|> an open doesn't necessarily load a page on a whim--and alls well w/ the
|> world.
|
| Exactly. What you really want is AIO semantics, and you could possibly
| fake it in ugly and unsatisfying ways with non-blocking semantics.
Faked? Just follow the logic and it can work.
--
|WARNING: Due to extreme spam, googlegroups.com is blocked. Due to ignorance |
| by the abuse department, bellsouth.net is blocked. If you post to |
| Usenet from these places, find another Usenet provider ASAP. |
| Phil Howard KA9WGN (email for humans: first name in lower case at ipal.net) |
.
- References:
- aio_read/write versus O_NONBLOCK
- From: RazvanD
- Re: aio_read/write versus O_NONBLOCK
- From: Rainer Weikusat
- Re: aio_read/write versus O_NONBLOCK
- From: phil-news-nospam
- Re: aio_read/write versus O_NONBLOCK
- From: Rainer Weikusat
- Re: aio_read/write versus O_NONBLOCK
- From: phil-news-nospam
- Re: aio_read/write versus O_NONBLOCK
- From: Rainer Weikusat
- Re: aio_read/write versus O_NONBLOCK
- From: phil-news-nospam
- Re: aio_read/write versus O_NONBLOCK
- From: Rainer Weikusat
- Re: aio_read/write versus O_NONBLOCK
- From: David Schwartz
- aio_read/write versus O_NONBLOCK
- Prev by Date: Re: aio_read/write versus O_NONBLOCK
- Next by Date: Re: Socket program
- Previous by thread: Re: aio_read/write versus O_NONBLOCK
- Next by thread: Re: aio_read/write versus O_NONBLOCK
- Index(es):
Relevant Pages
|