UNIX does *not* fully support asynchronous I/O

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Aug 31 03:36:05 AEST 1990


In article <1990Aug29.155253.18634 at chinet.chi.il.us> les at chinet.chi.il.us (Leslie Mikesell) writes:
> Does this have something to do with unix?

Yes. (As A. Lester Buck pointed out to me in e-mail, the functions I
proposed for truly asynchronous I/O are already in POSIX.)

> The usual concept of unix I/O
> is that something that is written to disk is likely to be read back and
> thus should live in the common buffer pool for a while.  

Ummm, no. The LRU philosophy tells us that something recently *written*
is likely to be *written* in the near future; something recently *read*
is likely to be *read* in the near future. That's the most important
reason that things are kept in buffers: it's stupid to make a one-byte
modification to a block when more bytes are probably on their way. A
second reason is so that writes can be scheduled to avoid disk seeks and
not keep the process waiting while the disk catches up.

Now it is true that pipes, for instance, are likely to be read very soon
after they are written. But pipes aren't inherently disk-based objects,
and if they're implemented purely in memory, asynchronous I/O means that
a pipe read-write takes zero data copies.

---Dan



More information about the Comp.unix.wizards mailing list